Reputation: 17
In my app I have following code:
tw.setText("1");
tw.setText("2");
I thought it will let 1 stay for a while and then display 2, but in fact, It only display 2, is there any way to fix this?
Upvotes: 1
Views: 70
Reputation: 47817
I guess you want to replace TextView
text. Then try this way
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
tw.setText("2");
}
}, 4000);
Upvotes: 2