gps - Android requestLocationUpdates not called properly -
i locate user clicking on button. therefore use code:
lm = getsystemservice(locationmanager.class); provider = locationmanager.gps_provider; listener = new locationlistener() { @override public void onlocationchanged(location location) {    log.e("update","updating location"); } @override public void onstatuschanged(string s, int i, bundle bundle) {  } @override public void onproviderenabled(string s) {  } @override public void onproviderdisabled(string s) {  } };  lm.requestlocationupdates(locationmanager.gps_provider, 0, 0, listener);   the requestlocationupdates method called onlocationchanged method called few times. gps activated , permissions granted.
do have idea why onlocationchanged not called? checked getlastknownlocation false after calling requestlocationupdates.
i think onlocationchanged() not suppose called always, called if location changes.
Comments
Post a Comment