We have some knowledge about multithreading. Now let's further study and apply it. Use it in android to change the title (changed once every 3 seconds): You only need to write the Activity implementation. Here there are two methods, you can choose to use it according to your habits. (1) Runnable: [html] public class MainActivity extends Activity {private int count = 1; private Handler handler = new Handler () {public void handleMessage (android. OS. message msg) {switch (msg. what) {case 1: updateTitle (); break; default: break ;}};@ Override public void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); new Thread (new TitleThread ()). start ();} protected void updateTitle () {setTitle ("my bolg" + count ++);} class TitleThread implements Runnable {@ Override public void run () {while (true) {Message message = new Message (); message. what = 1; handler. sendMessage (message); try {Thread. sleep (3000);} catch (InterruptedException e) {e. printStackTrace () ;}}}@ Override public boolean onCreateOptionsMenu (Menu menu) {getMenuInflater (). inflate (R. menu. activity_main, menu); return true ;}} (2) Timer: [html] public class TimerActivity extends Activity {private int count = 1; private Handler handler = new Handler () {public void handleMessage (android. OS. message msg) {switch (msg. what) {case 1: updateTitle (); break; default: break ;}};@ Override public void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_timer); Timer timer = new Timer (); timer. scheduleAtFixedRate (new TimerTask () {@ Override public void run () {Message message = new Message (); message. what = 1; handler. sendMessage (message) ;}}, 1000,3000);} protected void updateTitle () {setTitle ("hello" + (count ++ ));} @ Override public boolean onCreateOptionsMenu (Menu menu) {getMenuInflater (). inflate (R. menu. activity_timer, menu); return true ;}}