how to run background thread in android code example
Example: how to run a background thread in android
Thread thread = new Thread() {
@Override
public void run() {
try { Thread.sleep(2000); }
catch (InterruptedException e) {}
runOnUiThread(new Runnable() {
@Override
public void run() {
textView.setText("OK");
}
});
}
};
thread.start();