Schedule task in android

Posted by Maneesh on Stack Overflow See other posts from Stack Overflow or by Maneesh
Published on 2010-05-18T12:15:10Z Indexed on 2010/05/18 12:20 UTC
Read the original article Hit count: 344

Filed under:
|

I am using below code for scheduling a task in android but its not giving any results. Please advise on the same.

  int delay = 5000; // delay for 5 sec.

  int period = 1000; // repeat every sec.

  Timer timer = new Timer();

  timer.scheduleAtFixedRate(new TimerTask() {

              public void run() {

                   Toast.makeText(getApplicationContext(),"RUN!",Toast.LENGTH_SHORT).show();

                                }

                            }, delay, period);

© Stack Overflow or respective owner

Related posts about android

Related posts about android-emulator