On Thu, Jan 21, 2010 at 3:30 PM, Dirk Vranckaert <[email protected]>wrote:
> It seems your solution does not work either. > Um ... it should, I've used this technique repeatedly. Can you post the code you're using? > As long as I'm doing it in a thread it doesn't work. > Well, it depends on how you're running the thread. If you're posting it to the runOnUiThread() function, it should work. If you're starting it with Thread.start(), then yeah, that won't work. Again, some code would clarify. > Altough what I tried next was setting the error message for the user > in my catch clause. And right after the thread finished I handled the > showing of the errors based on wheater some error message was set or > not! > I'm not sure I follow here. > Thx for your help! (If you get me some advanced explanation on why > dialogs cannot be created from within a thread plz let me know!) > Probably because of the complexities of ensuring thread safety. If you could update the UI from any thread, you could run into various threading issues (deadlocks, race conditions, etc). If they core framework were designed to support this it would introduce more complexity and overhead to the system. Just a guess, but again, this is pretty standard behavior in GUI systems, so it's really something that's just accepted. ------------------------------------------------------------------------------------------------- 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

