Emre A. Yavuz wrote:
> Thanks for the quick response. If I update the visibility of the
> "loading" and "main" views in the UI thread once my background thread is
> done, won't I have the same problem since I'll still be in onCreate()
> method and thus no visual impact can be observed until *after*
> onCreate() returns ? 

In your case, onCreate() will call setContentView() with the loading
view visible, will fork a background thread (e.g., via AsyncTask), and
then will return. The user, at this point, will see the loading view.

In the meantime, the background thread will chug along and do its work.
That is the whole point of the background thread -- to allow onCreate()
to return and allow your initialization work to proceed in parallel.

When the background thread is done, it will tell the UI thread (e.g.,
via onPostExecute() in AsyncTask) to change the visibility of the
loading and main views to make the main one visible.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 1.0 In Print!

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