Update UI from another thread
<p>I know that update UI from another thread is forbidden, so I tried that to see what result I will get from the application. Yes, the app will crash when updating the UI component, but there is one case I don't understand, the app run fine.</p>

<p><strong>1)</strong> </p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        tv = (TextView)findViewById(R.id.textView1);
        bt = (Button)findViewById(R.id.button1);

        new Thread(){ //1                       
            public void run() {                             
                tv.setText("changed");                      
        }}.start(); //1  }  
    }
</code></pre>

<p><strong>2)</strong></p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        tv = (TextView)findViewById(R.id.textView1);
        bt = (Button)findViewById(R.id.button1);

        bt.setOnClickListener(new OnClickListener(){

            @Override
            public void onClick(View arg0) {
                 new Thread(){ //1                       
                        public void run() {                             
                            tv.setText("changed");                      
                    }}.start(); //1  }  
            }

        });


    }
</code></pre>

<p>Sorry for my previous description of my problem, I think most people misunderstand it, so I rephrase the question. There are 2 scenario above, they are supposed to give me crashing error because both create new thread and update the UI component, but in fact, only the second scenario crash but fisrt scenario  does not crash. Anyone know the reason?</p>
