Here is my code:
public void run() {
try {
while (!isInterrupted()) {
Thread.sleep(1000);
runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
}
} catch (InterruptedException e) {
}
}
};
thread.start();
The Thread
is called Thread
and I want to display the time in a TextView
called TextView
. There is some error in the Thread
because even though the time displays in the TextView
, it does not update every second. Thanks