Sunday, July 5, 2015

android: Call method after delay

Handler handler = new Handler();
 long waitingTime = 2 * 60 * 1000; // 2 min

 handler.postDelayed(new Runnable() {
 @Override
 public void run()
 {
     //Do something after 2 min         
 }
 }, waitingTime);

No comments:

Post a Comment