Android: How can i show a toast from a thread running in a remote service? Whenever i run from a different thread in a service, the app crashes...
public cl
if someone don't understand what context is in @Alex Gitelman answer. write your class name in place of context in which you are writing this handler code like this
Handler h = new Handler(MyClassName.this.getMainLooper());
h.post(new Runnable() {
@Override
public void run() {
Toast.makeText(MyClassName.this,"show toast message",Toast.LENGTH_LONG).show();
}
});