Splashscreen not showing Android PhoneGap
I am using PhoneGap 2.9.0 (cordova 2.7.0) to make an Android App. I want a
splashscreen in the application. I have followed all the steps mentioned
on:
http://docs.phonegap.com/en/2.9.0/cordova_splashscreen_splashscreen.md.html#Splashscreen
for setting up splashscreen. Still mentioning. I have added splash.png in
res/drawable-hdpi,res/drawable-xhdpi and so on...
I have the following code in my MainActivity.java file:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html", 10000);
I have the following code in index.html to hide the Splashscreen once the
document is loaded:
function onLoad(){
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
navigator.splashscreen.hide();
}
Still the Splashscreen Image doesn't show up when I run the app. Instead
when I load the application a BLANK BLACK SCREEN shows up for round about
10 seconds.
(P.S. The PNG image is a 9-Patch image. So no problem there too..
Moreover, I have tried uninstalling and reinstalling the app to make sure
there's no problem due to caching. Still no results)
Please help
No comments:
Post a Comment