Code example for ScheduledThreadPoolExecutor

Methods: shutdownNow

0
 
 
	@Override 
	public void onDestroy(){ 
		//stops drink timer to make sure we dont have any issues 
		_timer.shutdownNow();
		//Persist Data 
 
	} 
	@Override 
	public IBinder onBind(Intent arg0) {
		return null; 
	} 
// 
	//Custom methods for drink scheduler 
	public long calculateInterval(int tarDrinks, long startTime, long tarTime){
		long difference = Math.abs(tarTime-startTime);
		long interval = difference /tarDrinks; 
		return interval;
	} 
	public int calculateDrinks(Time tarTime, double BAC){