On Thu, Jan 21, 2010 at 1:47 PM, Dirk Vranckaert
<[email protected]>wrote:

> I certainly will try it out later this evening (studying for my
> certification right now)
>

Good luck!


> but is there any more detailed/advanced
> explanation about why I can't run a bunch of code in a thread and at
> the end of the thread start a dialog?
>

Basically, you can't do anything UI related in a non-UI thread. The details
of "why" is beyond me. This is just the way things work (it's like this in
Windows as well, for example). I've never bothered digging deeper than that
and just accepted this =P I'm sure a simple Google search will yield the
details of why this is the way it is (assuming an expert doesn't come along
and chime in).


> Why I have to start a nested
> thread with just the dialog creation?
>

Note that this is not the only solution. If you had a Handler in your class,
you could post a message at the end of your thread and have your handler
handle the message to display the dialog. Again, serving the same purpose of
doing the show() in the main thread. This is arguably more work and more
involved, though, depending on how you have things set up and how much
back-n-forth you have going on between threads and the UI.

Anyway thx in advance for giving me a possible working solution
>

Sure thing. Hope it helps.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to