I have the identical code in a similar situation, and the dialog showed up when i put in a timer before dismissing it. On mine, I've basically assumed that the data retrieval and processing is happening before the dialog really has a chance and am hoping that it will show up on phones that are using a slower 3G connection rather than a direct connection to the net.
See it yours works if you throw in a timer to make it wait a few seconds before calling dismiss(). I'm betting that it will. I'll leave it to others to say whether it will work properly without the timer when actually deployed, as I haven't reached that point yet. On Mar 10, 6:12 pm, David Williams <[email protected]> wrote: > All, > > I have my main class GolfCaddie.java which is called when the app is > launched. GolfCaddie.java extends the TabActivity. > I have 3 other classes, one for each tab, and at the moment these 3 > classes just display text or graphics. > > In GolfCaddie.java the code is broken down as follows. Trying to > simply it but can provide full code if needed: > > onCreate > Set up Tabs > Call initApp > > onCreateOptionsMenu > Setup options Menu > > initApp > ProgressDialog dialog = ProgressDialog.show(GolfCaddie.this, > "","Initializing. Please wait...", true); > Set up some variables > Obtain deviceID > Checks app name, and determines if this is the trial version or the > full version > Makes a call to my server and returns a JSONObject which is then > decoded and certain items checked. > If the app is the trial version AND the trial date has passed throw > up an Alert with a message. Only option is to click OK which closes the App. > Otherwise, if the app is the trial version through up an alert > showing when the trial expires. > dialog.dismiss(); > > That's it for now. Very crude but working. My problem is that the > ProgressDialog never shows up, and all the code in initApp is done > against a black screen, even though the onCreate sets the tab default to > 0, which has a graphical backdrop. Probably not doing this in the > correct way, but I was hoping for the ProgressDialog to display (againt > Tab(0) which has the background image) whilst it performs the code in > initApp. The call to my server is quick, but it's possible it can take > upwards of 10-20 seconds depending upon connectivity and so wanted to at > least show that something was happening. Having a black screen is not > great at all. > > Would appreciate any help, and again, I can provide more detailed code > if needed. > > TIA. > -- > ------------------------------------------------------------------------ > > David Williams > Check out our WebOS mobile phone app for the Palm Pre and Pixi: > <http://www.dtw-consulting.com/GolfCaddie> Golf Caddie > <http://www.dtw-consulting.com/GolfCaddie> | Golf Caddie Forum > <http://www.dtw-consulting.com/GolfCaddie/forum> | Golf Caddie FAQ > <http://www.dtw-consulting.com/GolfCaddie/faq.html> by DTW-Consulting, Inc. -- 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

