No splashscreen for home/launcher app + unable to reshow splashscreen
See original GitHub issueBug Report
Problem
Upgrading to cordova-android@11 and the new splashscreen system comes with 2 regressions in my app:
- Android does not seem to use the splashscreen API for home/launcher app (tested in
system-images;android-31;default;x86_64
), which result in splashscreen completely missing in my app; there is no redraw on screen until my app closes the splashscreen - there is no no way to reshow the splashscreen; this is a bummer as the previous splashscreen system was a very convenient interstitial screen to use while the app was reloading
To reproduce:
- create a new app
- add cordova-android@11 platform
- use preferences:
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="RemoveSplashScreenOnPause" value="false" />
- add utility button in
www/index.html
:
<button id="splashscreen-button">Show splashscreen</button>
- edit
www/js/index.js
:
function showTemporarySplashscreen() {
navigator.splashscreen.show();
setTimeout(() => navigator.splashscreen.hide(), 3000);
}
function onDeviceReady() {
...
setTimeout(() => navigator.splashscreen.hide(), 3000);
document.getElementById('splashscreen-button').addEventListener('click', showTemporarySplashscreen, false);
}
- edit activity in
platforms/android/app/src/main/AndroidManifest.xml
:
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
What is expected to happen?
- splashscreen is always displayed at startup
- it is possible to reshow the splashscreen at runtime
What does actually happen?
When starting the app from the app drawer, the splashscreen is displayed. But when installing the app as the default launcher, killing the app, and restarting, one can see no splashscreen is displayed by Android.
Also the inability to reshow the splashscreen is a real regression IMO. I understand the limitation of the new SplashScreen API, but maybe it would have been better to design the new cordova splaschreen system as a complement to the legacy system, with opt-in capability for the legacy system, instead of fully replacing the legacy system with loss of functionality.
Version information
- cordova-android@11
- Android 12 (emulator:
system-images;android-31;default;x86_64
)
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Android skipping the splash screen when re-opening the app ...
When the user then taps the app icon on the HOME screen or taps on the app's task in the list of recent...
Read more >Splash screen doesn't disappear · Issue #71 - GitHub
It works fine so far (no updates, nothing new), but splash screen now doesn't disappear, no error in build. If I remove [Splashscreen...
Read more >Apps not Launching/ stuck on splash screen : r/android_beta
I keep restarting it, and even shut it down from the bootloader, but it doesn't stop. Update: My phone just got the 2.1...
Read more >"De-bloating" the Chromecast with Google TV. Let's get rid of ...
Go to Settings > All Apps > "See All apps" > "Show System apps" > Google > click on "Uninstall Updates" & "Disable"....
Read more >Notifications Overview | Android Developers
A notification is a message that Android displays outside your app's UI to provide ... Starting with Android 8.0, users can choose to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the extensive response. We can just agree to disagree, but I wouldn’t say the legacy system is incompatible with the Android 12 spashscreen API. It could be seen as complementary. Given the limitation of that new API, I would have prefered to see cordova-android embracing the new API as a separate feature, instead of clobbering the existing legacy system and making it completely incompatible. I don’t see the potential double splashscreen as a serious/blocking issue. This would have been less disruptive for app developers.
The problem I see is different than the one described in the doc. But it may still be a bug in the emulator, though.
For me the splash screen is appearing on android 13, but I only build regular apps, not launcher apps. If it doesn’t work there you should report it to google so maybe they fix it in a future 13.x release or 14.