2

I have a service running with a background thread polling for XMPP messages. I want to issue a toast from the Thread. Previous stackoverflow questions have dealt with this by using the runOnUiThread Activity method, however this is not available in a Service. My question is what is the suggested method in a Service? Many thanks in advance

jonnydedwards
  • 180
  • 10
  • [This Question](http://stackoverflow.com/questions/4025082/android-toast-started-from-service-only-displays-once) should help you. – fredley Jan 19 '11 at 12:26

1 Answers1

-1

You could try to callbacks similar to the example at http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html. Specifically see the section starting with the comment

/**
 * Our Handler used to execute operations on the main thread.  This is used
 * to schedule increments of our value.
 */
JLund
  • 496
  • 1
  • 4
  • 14