I added a splash screen to my phonegap application by adding the super.setIntegerProperty("splashscreen", R.drawable.splash);
line before the super.loadURL...
line in the DefaultActivity
.
Is there a way to lock only the splash screen's orientation to portrait without locking the whole application?
After many searches I've found that the right way to address splash screen orientation is to manage two images using this code into your MainActivity
if (getResources().getConfiguration().orientation == 2) {
super.setIntegerProperty("splashscreen", R.drawable.splashlandscape);
Log.d("Orientation", "Landscape");
}
else {
super.setIntegerProperty("splashscreen", R.drawable.splashportrait);
Log.d("Orientation", "Portrait");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With