Ricardo
Ricardo

Reputation: 8291

Android - Maps - My location button not working and blue dot is not showing

Just right after I accept request permission location ACCESS_FINE_LOCATION the location button is showing but not working. I've just pushed it but nothing happens. Where is the blue dot??

In the other hand, when I restart the app the button is working properly.

This is my code just after permissions has ben accepted:

googleMap.setMyLocationEnabled(true);   
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
googleMap.getUiSettings().setAllGesturesEnabled(true);
googleMap.getUiSettings().setZoomControlsEnabled(true);

enter image description here

Upvotes: 3

Views: 3126

Answers (1)

Alessandro Mautone
Alessandro Mautone

Reputation: 883

try to set

googleMap.setMyLocationEnabled(true); googleMap.getUiSettings().setMyLocationButtonEnabled(true);

after accepting the permissions

Upvotes: 2

Related Questions