1. Download our Official Android App: Forums for Android!

Apps how to set timer in android application

Discussion in 'Android Development' started by ritusingh, Dec 21, 2009.

  1. ritusingh

    ritusingh Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Dec 11, 2009

    Dec 11, 2009
    2
    0
    5
    Hi Frens,

    can anyone please tel me how to set timer in android application?
    i have followed the code given below but it is not responding-

    Timer t=new Timer();
    im1=new ImageView(this);
    TimerTask t1=new TimerTask()
    {
    synchronized
    public void run()
    {
    im1.setImageResource(R.drawable.b);
    setContentView(im1);

    }

    };
    t.schedule(t1, 2*1000);
    this code is not working.
    so please anybody help me out.

    thanx-
    Ritu Singh
     

    Advertisement

  2. Carl C

    Carl C Android Expert
    Rank:
    None
    Points:
    238
    Posts:
    6,062
    Joined:
    Sep 11, 2009

    Sep 11, 2009
    6,062
    38
    238
    Student
    London
    Moving to Android developers forum as you may get a better response :)
     

Share This Page

Loading...