diff --git a/README.md b/README.md index ff790b1..63ee109 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ In your `config.xml`, you need to add the following preferences: + Where foo is the name of the splashscreen file, preferably a 9 patch file. Make sure to add your splashcreen files to your res/xml directory under the appropriate folders. The second parameter represents how long the splashscreen will appear in milliseconds. It defaults to 3000 ms. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) for more information. @@ -74,6 +75,8 @@ for more information. The plugin reloads splash drawable whenever orientation changes, so you can specify different drawables for portrait and landscape orientations. +"SplashShowOnlyFirstTime" preference is also optional and defaults to `true`. When set to `true` splash screen will only appear on application launch. However, if you plan to use `navigator.app.exitApp()` to close application and force splash screen appear on next launch, you should set this property to `false` (this also applies to closing the App with Back button). + ### Browser Quirks You can use the following preferences in your `config.xml`: diff --git a/src/android/SplashScreen.java b/src/android/SplashScreen.java index 75ad724..16bc769 100644 --- a/src/android/SplashScreen.java +++ b/src/android/SplashScreen.java @@ -89,7 +89,10 @@ public class SplashScreen extends CordovaPlugin { // Save initial orientation. orientation = cordova.getActivity().getResources().getConfiguration().orientation; - firstShow = false; + if (preferences.getBoolean("SplashShowOnlyFirstTime", true)) { + firstShow = false; + } + loadSpinner(); showSplashScreen(true); }