Here's a simple example of sending a Message from a background thread to
the main thread:
Handler handler = new Handler(Looper.getMainLooper());
Message message = handler.obtainMessage();
// Set what, arg1, arg2, or obj if needed
handler.sendMessage(message);
Remember: Always obtain a Message from a Handler instance. This ensures the
Message is correctly associated with the Handler's Looper.
No comments:
Post a Comment