android - Phonegap splash screen not loading -
i'm working on application android using phonegap 3.5.0 - testing device samsung galaxy tab (gt-p5100) android 4.1.2 .
half year ago did first tests phonegap. remember splashscreen loading @ startup following line in config.xml
<gap:splash gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" />
now hard- , software mentioned above it's not working anymore...
i tried following:
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" /> <gap:splash gap:platform="android" gap:density="ldpi" src="res/screen/android/screen-ldpi-portrait.png" /> <gap:splash gap:platform="android" gap:density="mdpi" src="res/screen/android/screen-mdpi-portrait.png" /> <gap:splash gap:platform="android" gap:density="hdpi" src="res/screen/android/screen-hdpi-portrait.png" /> <gap:splash gap:platform="android" gap:density="xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" /> <gap:splash gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" />
and of course:
<gap:plugin name="org.apache.cordova.splashscreen" />
any suggestions? thanks!
p.s.: not working on sony xperiia z1 android 4.4.4, too.
for phonegap vesions above 3.5 require splashscreen plugin in order load splashscreen.you can download here (https://github.com/apache/cordova-plugin-splashscreen/blob/master/doc/index.md). can use native java code display splash screen
//splash.java
public class splash extends activity { protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //show splash screen 3 seconds setcontentview(r.layout.splash); public void run() { try{ sleep(3000); }catch(interruptedexception e){ e.printstacktrace(); }finally { //launch mainactivity after 3 seconds mainactivity.class phonegap default javafile intent mainactivity = new intent(splash.this,mainactivity.class); startactivity(mainactivity); } @override protected void onpause() { // todo auto-generated method stub super.onpause(); finish(); } }
note:set splash.java launcher activity , made appropriate changes in manifest file
Comments
Post a Comment