Code example for Timer

Methods: cancel

0
    	new Thread() { 
    		@Override 
    		public void run() { 
    			super.run(); 
 
    	    	timer.cancel(); 
    	    	servoRunner = false; 
    			try { 
    				servoThread.join(); 
    			} catch (InterruptedException e) { 
    				Log.e(LOG_TAG, e.getMessage()); 
    			} 
    		} 
    	}.start(); 
		runOnUiThread(new Runnable() { 
			@Override 
			public void run() { 
				seekBar.setEnabled(false); 
				toggleButton.setEnabled(false); 
				toggleButton.setChecked(false);