Welcome to the Android Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 3 of 3
  1. Thread Author  Thread Author    #1  

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

    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.
  2. #2  

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

    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.
  3. #3  

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

    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();

Similar Threads

  1. Android programming
    By jkepler in forum Software Development and Hacking
    Replies: 26
    Last Post: 11-18-2014, 04:04 PM
  2. Replies: 7
    Last Post: 07-22-2014, 12:20 AM
  3. Replies: 1
    Last Post: 06-04-2014, 11:24 AM
  4. Transfer Music Player playlists to doubletwist?
    By zigibogido in forum Android Apps
    Replies: 0
    Last Post: 06-04-2014, 06:05 AM

Posting Permissions