Need Help: Splashscreen for android 12 using Vue/Capacitor #8169
Replies: 1 comment
|
The second screen you're seeing isn't a splash screen at all — it's your window background, and that's why none of the splash-screen settings make it go away. Here's the actual sequence on Android 12+:
Your The fixGive the post-splash theme the same background as the splash: <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<!-- visible from splash dismissal until the WebView paints its first frame -->
<item name="android:windowBackground">@color/splash_bg</item>
<item name="android:background">@color/splash_bg</item>
</style>Once the two colours match, step 2→3 is invisible: the user sees one continuous screen instead of a splash followed by a white flash. Two things worth knowing while you're in there:
Two logos read as two splashes. If your own app renders a logo on first paint, the system splash icon plus your logo look like two consecutive splash screens even when the colours match. You can leave only the background from the system splash by pointing the icon at a transparent drawable: <!-- res/drawable/splash_empty.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:width="1dp" android:height="1dp" />
<solid android:color="@android:color/transparent" />
</shape><item name="windowSplashScreenAnimatedIcon">@drawable/splash_empty</item>Omitting the attribute doesn't work — the system falls back to your launcher icon. It has to be an explicitly transparent shape. About the 10 secondsThe colour fix removes the flash, not the delay. The Android 12 system splash is around a second at most; 10 seconds means something else is holding the app. Two things to check:
|
Uh oh!
There was an error while loading. Please reload this page.
I'm building a Vue/Capacitor app that allows users to input data and generate a PDF. It's a single-page app with 10 input fields, and it's being tested on an emulator via Android Studio.
The issue I'm facing is with the splash screen behavior on Android 12+. When launching the app, I see two splash screens:
The first splash screen shows the app icon centered on a colored background — I believe this is the Android 12 system splash.
After about 10 seconds, it transitions to a completely white screen that lasts another 6–10 seconds before the app finally loads.
I want to remove the second white screen entirely and have the Android 12 splash until the app is ready. The app doesn't use network and should load quickly, so this delay seems excessive.
Here’s my current setup:
AndroidManifest:
`
type
`
Styles.xml:
`
`
MainActivity.java:
`package.com.begginer1app
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}
`
All reactions