android - get latitude & longitude zero while run app first time, but after 10 mins, it will get correct values. how to fix this? -


first time getting:

latitude:0.00 longitude:0.00 address: not found 

after 10 mins getting:

latitude:13.00666178 longitude:80.25727619 address:some address 

locationmanager locationmanager; location location;  locationmanager = (locationmanager) getsystemservice(context.location_service); location =locationmanager.getlastknownlocation(locationmanager.network_provider);     if (locationmanager.isproviderenabled(locationmanager.gps_provider)) {          location = googlemap.getmylocation();          if (location != null) {             latlng latlang = new latlng(location.getlatitude(),location.getlongitude());             cameraupdate = cameraupdatefactory.newlatlngzoom(latlang, 17);             googlemap.animatecamera(cameraupdate);         } } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -