* @see LocationManager#requestLocationUpdates(String, long, float, LocationListener)
*/
public static void location(final Context context, final Address replyTo, final String provider,final long minTime,final float minDistance){
- final LocationManager man=(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
+ final LocationManager man=(LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
if(locationListener!=null)
nolocation(context, toNonNull(Address.BLACKHOLE));
Utils.registerOngoing(context, toNonNull(OngoingEvent.LOCATION));
*/
public static void nolocation(final Context context, final Address replyTo){
Utils.unregisterOngoing(context, toNonNull(OngoingEvent.LOCATION));
- final LocationManager man=(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
+ final LocationManager man=(LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
man.removeUpdates(locationListener);
locationListener=null;
Utils.sendMessage(context, replyTo, no_longer_listening_for_location_updates);