Schedule task in android
- by Maneesh
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);