Android: How can i show a toast from a thread running in a remote service?

This is how I did it. Of course, you need to pass appropriate context.

   Handler h = new Handler(context.getMainLooper());

    h.post(new Runnable() {
        @Override
        public void run() {
             Toast.makeText(context,message,Toast.LENGTH_LONG).show();
        }
    });

Leave a Comment