How to add a delay between two actions
2 answers
You can use Handler with postDelay. the duration of the pass in milliseconds, then run () is called after the specified duration.
Handler h = new Handler();
Runnable r = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
// code that will run after 1 second(1000 ms)
}
};
h.postDelayed(r, 1000);
+1
source to share