I call the method and wait for the location to update a few times:
locationManager.requestLocationUpdates("gps",0 ,0, loc_listener);
My loc_listener is defined as:
LocationListener loc_listener = new LocationListener() { private final String TAG = "xoxoxo.LocationListener"; public void onLocationChanged(Location l) { Intent locationAlert = new Intent("xoxoxo.LOCATION_CHANGED") .putExtra("target_location", l); sendBroadcast(locationAlert);
It is defined as it is, I will only receive the update once, both on HTC Evo 2.2 emulators and on 2.2 + Google APIs. The hack to get multiple updates is to uncomment the line that registers updates for each update:
locationManager.requestLocationUpdates("gps", 0 ,0, this);
Have you guys seen something like this?
android location
Denis masyukov
source share