X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FHeavy.java;h=2e379e0facc570f95078b5062bb60847a98cc5e8;hb=878b06d456f2f0c67c3e751301c77aecca16e0c4;hp=3249db8208a37e841c75a35380ac5cd03e5ea066;hpb=06a86a92d44173f1cdd7e595259596f09f30142f;p=fonbot.git diff --git a/src/ro/ieval/fonbot/Heavy.java b/src/ro/ieval/fonbot/Heavy.java index 3249db8..2e379e0 100644 --- a/src/ro/ieval/fonbot/Heavy.java +++ b/src/ro/ieval/fonbot/Heavy.java @@ -939,7 +939,7 @@ final class Heavy { * @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)); @@ -1049,7 +1049,7 @@ final class Heavy { */ 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);