final Date locationDate=new Date(loc.getTime());
sb.append(" ");
sb.append(toNonNull(context.getString(at)));
+ sb.append(" ");
sb.append(locationDate.toString());
Utils.sendMessage(toNonNull(context), toNonNull(replyTo), toNonNull(sb.toString()));
}
case REBOOT:
Utils.sendMessage(context, replyTo, reboot_help);
break;
- case SHUTDOWN:
- Utils.sendMessage(context, replyTo, shutdown_help);
- break;
case NOTIFY:
Utils.sendMessage(context, replyTo, notify_help);
}
* @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);