use this code
handler = new Handler(); handler.postDelayed(changeFunction(), 10*1000);
write above in onCreate ()
private Runnable changeFunction(){ t = new Timer(); tt = new TimerTask() { public void run() { handler.postDelayed(changeFunction(), 10*1000); button.setText("WAIT"); } }; return tt; }
source share