Thursday, June 23, 2011

[android-developers] best way to implement a thread requring a result from a function that must be run on the UI thread

I am in a thread that I did not create, its part of a library and I
need to generate a result which can only be done in the UI thread.
Any good tutorial on the best way to achieve this?

I know I will have to post a handler to the UI thread, but whats the
best way for the UI thread to return the result? And I have to make
the other thread wait for the result.

A good code snipped would help. Thanks.

--
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