不使用sleep,直接设置teztview.settext("2222222222222");系统并没与崩溃,但是加上sleep之后在运行就崩溃了
public class MainActivity extends ActionBarActivity {
private TextView textview;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textview=(TextView) findViewById(R.id.TextView);
new Thread(){
public void run() {
textview.setText("吴俊杰!加油啊!");
};
}.start();
}
}