I got the impression that the views can only be manipulated from the main thread ... however, why this is NOT a failure:
public class MainActivity extends Activity { TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tv = new TextView(this); tv.setText("original text"); setContentView(tv); new Thread(new Runnable() { @Override public void run() { tv.setText("trollollolol i should die here but i won't."); } }).start(); } }
I worked on the device and the emulator, both work fine, and I see the text change. what's happening?
i also checked thread ids, and the background thread is NOT DEFINED, not the main thread (threadID = 1)
source share