i have a function To run messages in a queue. But when I run this the last handler gets executed only, not the first one! Help!
void functionShow()
{
button.setVisibility(View.INVISIBLE);
txt.setText("Generating Unique ID ... Please Wait ");
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
txt.setText("Sending SMS ... Please Wait");
}
}, 10000);
Handler handler1 = new Handler();
handler1.postDelayed(new Runnable () {
public void run()
{
txt.setText("Done");
}
}, 10000);
}
All i am trying to do is: First text should come as “Generating Unique ID … ” Then after 10 secs “Sending SMS … ” Then again after 10 secs “Done”
Both have the same delay… I guess the first one is being executed and a couple of milliseconds after that the second one is executed; so it looks like the second one is the only that is being executed.
The ugly way:
The cool way: