Skip to content Skip to sidebar Skip to footer

Adding Default Location If User Doesn't Allow Permission For A Fine Location For A Map In Android

I am starting to learn about the runtime permissions. I have a map and I made a permission. If user allows fine location - map zooms to his current location, and if he doesn't allo

Solution 1:

You can zoom to location manually with this code :

CameraUpdate center=CameraUpdateFactory.newLatLng(new LatLng(latitude,
longitude));

CameraUpdate zoom=CameraUpdateFactory.zoomTo(15);

map.moveCamera(center);
map.animateCamera(zoom);

Solution 2:

Couldn't find solution so I put the permission inside the parent activity. I think it is a known bug.


Post a Comment for "Adding Default Location If User Doesn't Allow Permission For A Fine Location For A Map In Android"