So schedule a message in a Handler of the main thread, and show it there. Basically the same as any time you want to touch other parts of your UI.
--
Dianne Hackborn
Android framework engineer
hackbod@android.com
Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.
-- On Fri, Jun 11, 2010 at 10:42 AM, Flying Coder <av8r.steve@gmail.com> wrote:
Hi Mark,
Thanks for the suggestion, but unfortunately, SystemClock.sleep()
doesn't do the trick. :-(
Cheers,
Steve
> Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
On Jun 11, 1:22 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Flying Coder wrote:
> > So, I have an IntentService that handles button callbacks from a
> > widget. When the user presses a certain button, I want to display a
> > Toast. I return from onHandleIntent almost immediately after doing
> > Toast.show(), which in turn stops the service and kills its thread,
> > which keeps the Toast from actually being displayed.
>
> That's interesting. I've never tried that pattern. I'm a bit surprised
> that the Toast doesn't fire.
>
> > Can anyone suggest an easy way to get the Toast (or something similar)
> > to display from an IntentService?
>
> Have you tried SystemClock.sleep()? It's a serious kludge, but I don't
> know what else you can do.
>
> --
>
> Android Consulting:http://commonsware.com/consulting
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Dianne Hackborn
Android framework engineer
hackbod@android.com
Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment