How to use java.Time and Timer Task in Android program. ?

DenPit85

New member
Apr 28, 2014
1
0
0
Can anyone show me an example of how to incorporate these in an Android program. I need a short time delay in an App I am writing and I think that the Java Timer and TimerTask could be the answer but I do not know how to implement them in the code.
 
Much better to use a CountDownTimer instead.
Sorry I cann't place a code here, forum gives me an error cause I just registered here.
 
Code:
countDownTimer = new CountDownTimer(timerLife, tickInterval) 
{
	@Override
	public void onFinish() 
	{
		// WRITE YOUR CODE TO RUN AFTER A DELAY
	}

	@Override
	public void onTick(long millisUntilFinished) 
	{
		
	}
}.start();