MainActivity.java
public class MainActivity extends Activity { private static int i=0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Timer timer=new Timer(); timer.scheduleAtFixedRate(new MyTask(), 100, 3000); } private Handler myHandler=new Handler(){ public void handleMessage(Message msg){ switch(msg.what){ case 100: setTitle("Welcome to here "+i); i++; break; } } }; private class MyTask extends TimerTask{ public void run(){ myHandler.obtainMessage(100).sendToTarget(); } } }