Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { // Execute task here } });
Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { // Update UI here } });
Handler handler = new Handler(); handler.post(new Runnable() { @Override public void run() { // Execute task in background thread here } });Overall, android.os.Handler post() is a very useful method that allows you to execute a task in the future, send messages to the UI thread, and run long running tasks in a background thread.