11
我在我的onCreate()
方法中添加了这部分代码,它崩溃了我的应用程序。 需要帮助。应用程序崩溃与“调用错误线程异常”
logcat的:
android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread
that created a view hierarchy can touch its views.
CODE:
final TextView timerDisplayPanel = (TextView) findViewById(R.id.textView2);
Timer t = new Timer();
t.schedule(new TimerTask(){
public void run(){
timerInt++;
Log.d("timer", "timer");
timerDisplayPanel.setText("Time ="+ timerInt +"Sec");
}
},10, 1000);
(我不知道,如何使用处理程序。) - 我读了一些我需要使用处理程序对象。\ –