Я добавил эту часть кода в свой метод onCreate()
, и это приводит к сбою моего приложения.
нужна помощь.
LOGCAT:
android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread
that created a view hierarchy can touch its views.
КОД:
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);