It may be that you need to change how you think of your code.
All mobile platforms (and a good many other platforms as well) use an
even model. They don't wait on another thread really, they wait for an
event to happen.

What your talking about would be dangerous on any platform, but on a
mobile platform like Android, your likely going ton run into trouble
even soon and have a harder time debugging the concurrency problems.

Doesn't answer you question I know, but maybe you should rethink your
approach.

- Brill Pappin


On Jan 6, 6:53 pm, Chris <cjse...@gmail.com> wrote:
> This is probably a "newbish" question but let's say i'm in Thread B
> and I need to do something on my UI Thread (Thread A) but it's
> critical that B doesn't continue to execute until A has gotten around
> to actually handling my request.
>
> We can start off with something like this:
>
> mThreadA_Activity.runOnUiThread(new Runnable(){ public void run()
> { mThreadA_Activity.DoSomeWork(); } } );
>
> If i understand correctly, that will post a message into Thread A's
> message queue and when it gets around to it, it will run
> "DoSomeWork()" but that whole call is asynchronous so it'll return
> immediately....
>
> ...but i want to wait for that call to actually go through. What are
> some ways of doing this?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to