Your loading shouldn't be done on the main event thread. You should have some modes/state machine that shows some kind of splash and then does the loading in another thread.

I have modes and a stack system. So I start by pushing on the Menu mode, then the Loading and finally the Splash. So the Splash gets shown, then the loading runs and then the menu.

Leigh

On 9/22/2010 1:24 PM, Kakyoin wrote:
Hi.


My situation:
I've a lot of  initialization code in my main activity's onCreate().
When I launch my game, the screen goes black for a long time, then my
game appears.
I did logged some message at the start and end of onCreate() and found
that onCreate() is executing its code while the screen is black.


OK, here's the problem:
Sometimes the screen goes black for too long and phone shows a popup
dialog prompting me to choose between Force close/Wait.  Then when
onCreate() is completed, my game appears. Choosing 'Wait' then dismiss
the dialog.


How to solve this?
I tried using progress dialog described in this article
http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog

But it doesn't work. The screen goes black for the same amount of time
even after I use the progress dialog.

Thank you in advance!


--
Leigh McRae
www.lonedwarfgames.com

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