Code example for Timer

Methods: cancel, purge

0
 
	@Override 
	public void onDestroy() { 
		Log.d(COMPONENT, "onDestroy");
 
		clock.cancel();
		clock.purge();
 
		locationManager.removeUpdates(passiveLocationListner);
		locationManager.removeUpdates(gpsLocationListner);
		 
		 
		Toast.makeText(this, "service stopped", Toast.LENGTH_SHORT).show();
		LogFile.log("Stop Service"); 
	} 
 
	/** 
	 * Class for clients to access. Because we know this service always runs in 
	 * the same process as its clients, we don't need to deal with IPC. 
	 */ 
	public class LocalBinder extends Binder {