You can display a warning dialog from the background with any of the following ...
1. runOnUiThread
You need to show your dialog box in the user interface thread as shown below ...
runOnUiThread(new Runnable() { @Override public void run() {
2. Handler
You can create a handler in the Activity class and call sendMessage for this handler object. Write code to display a warning in the handleMessage method of the handler, for example:
Action class
Handler mHandler = new Handler() { public void handleMessage(Message msg) {
Theme
Thread thread= new Thread() { public void run() {
source share