I have a Game Activity
(Activity A) that works well with all the code. Then I create a new Activity
(Activity B) for my new game mode, that e
Try this:
Handler innerHandler;
(new Thread(new Runnable() {
@Override
public void run() {
Looper.prepare();
innerHandler = new Handler() {
@Override
public void handleMessage(Message message) {
Toast.make(...);
}
@Override
public void dispatchMessage(Message message) {
handleMessage(message);
}
};
Message message = innerHandler.obtainMessage();
innerHandler.dispatchMessage(message);
Looper.loop();
}
})).start();
There may be an easier way to handle the problem. Please refer to Android – Multithreading in a UI environment documentation.