Bad Code!Why?

public class MainActivity extends Activity {
 
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            new MyThread().start();
        }
 
        class MyThread extends Thread {
 
            @Override
            public void run() {
                while (true) {
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
 
    }
posted @ 2015-06-29 22:41  神奇的洋葱  阅读(243)  评论(0编辑  收藏  举报