I have a PhoneGap/Sencha Touch app that has three basic states on app load: splash screen, webview is loaded but Sencha Touch is loading, and Sencha Touch is fully loaded.
On some Android phones (such as my Kyocera Rise), everything goes smoothly. I see the splash screen, then on deviceready
, navigator.splashscreen.hide()
is successfully called. The html/css hardcoded loading indicator that I have on index.html
is shown while Sencha Touch is loading, then when the Sencha Touch code is loaded it shows the fully-loaded app.
However, on other phones (such as my Galaxy S3), things do not work so well. I see the splash screen, then deviceready
the splashscreen is hidden. However, the hardcoded loading indicator on index.html
does not appear. All I see is a white (or sometimes black) screen. When the Sencha Touch code is fully loaded, the app does successfully appear, however.
Here's what I've tried:
- Removing various pieces of code. Removing the Sencha Touch code entirely does get rid of the flash and lets the hardcoaded loading indicator on index.html
appear.
- Putting a few-second delay on when the Sencha Touch code fires. Didn't work
- Firing a javascript alert on
deviceready
gets rid of the flash and lets the loading indicator appear. - Replacing the loading indicator with just text:
<body>loading</body>
. Didn't work. - Forcing
index.html
to rerender by changing its background color as well as switching betweendisplay:none
anddisplay:block
. Didn't work. - Removing the
deviceready
listener and just runningnavigator.splashscreen.hide()
right after the<body>
markup onindex.html
. Didn't work.
Based on this information, it looks like this has something to do with Sencha Touch, since completely removing the Sencha Touch code lets the loading indicator show. Maybe has something to do with rendering as well, given that the alert indicator also lets the loading indicator show. However, that's all I've got. It looks like other people have encountered this sort of thing, primarily on iOS and Blackberry though. I haven't found any proposed solution that I've seen elsewhere that seems to fix my issue; a lot of it is just the fact that people used to not be able hide the splashscreen on deviceready.
Is there something I'm missing here? Why might this sort of thing be happening? Why would it only happen on some Android phones?
navigator.splashscreen.hide()
toApplication.launch
method. Also, try your code in Ripple Emulator, it might help to understand what causes the problem: chrome.google.com/webstore/detail/ripple-emulator-beta/… – Baidaly