Code example for Timer

Methods: cancel, purge

0
	}; 
	 
 
	public void delayedLock(int time) {
		if(lockTimer != null) {
			lockTimer.cancel();
			lockTimer.purge();
			lockTimer = null;
		} 
		 
		lockTimer = new Timer("ScreenLock-timer");
		 
		lockTimer.schedule(new LockTimerTask(), time);
	} 
	 
	 
	public void show() { 
		setVisibility(VISIBLE);
		if(activity != null) {
			Window win = activity.getWindow();
			win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);