As I said, you need to change your textView in the user interface thread (the thread that created the component).
To do this, use a handler, for example: (Do not loop in your thread, just send a message to the handler)
private TextView tv1; Handler tick_Handler = new Handler(); MyThread tick_thread = new MyThread(); private class MyThread implements Runnable { public void run() { String txt = "Vlakno id:" + Thread.currentThread().getId()+" THREAD"; Log.v("MyActivity", txt);
By the way, if you want to have an accurate timer, you should indicate every 300 ms. You may see some strange seconds if you execute your "showtime" method every second.
source share