06-06 23:50:28.340 27670-27706/mys.timer E/AndroidRuntime: FATAL EXCEPTION: Timer-0
Process: mys.timer, PID: 27660
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
My code:
protected void onCreate(Bundle savedInstanceState) {
public void run() {
new Timer().scheduleAtFixedRate(new TimerTask(){
@Override
public void run(){
status.setText(getResources().getString(R.string.timercount));
status.setTextColor(Color.parseColor("#990000"));
}
}
}
Please tell me how can i avoid my app from closing itself