All articles

Technical

How to Customise Splash Screens and Stop White Flashes in TWAs

November 3, 2026 · 6 min read

When converting a Progressive Web App into a native Android application using a Trusted Web Activity, user experience is the primary metric of success. A seamless transition from the Android home screen to your web content is essential. However, many developers encounter a jarring visual transition known as the white flash. This issue occurs during the handover phase when the native Android application shell hands over rendering duties to the underlying browser engine.

Understanding the Handover Phase

To eliminate the white flash, you must first understand the life cycle of a TWA launch. When a user taps your application icon, the Android system launches the native wrapper. At this moment, the web browser has not yet loaded or compiled your JavaScript, HTML, and CSS. The native wrapper displays a placeholder, which is the native splash screen. Once the browser engine is ready, it initialises the web view, downloads or retrieves the cached web app shell from the service worker, and renders the first paint. If the background colours of these different stages do not align, or if there is a delay in browser initialisation, the user sees a sudden flash of white or contrasting colour.

Aligning the Web App Manifest with the Native Wrapper

The first step in achieving a seamless transition is ensuring absolute consistency between your Web App Manifest settings and your Android wrapper configuration. If your web app uses a dark theme, but your Android wrapper is configured with a default light theme, a flash is guaranteed to occur. You must synchronise your theme and background colours across both platforms.

In your Web App Manifest, typically named manifest.json, you define the background_color and theme_color. The background colour in the manifest is used by the browser to display a placeholder before the stylesheets have loaded. In your native Android wrapper, these properties are configured within the build configuration or the resource files, depending on how you build your project.

Configuring Splash Screen Meta-Data in the Android Wrapper

The native Android wrapper uses specific configuration values to determine how the splash screen is constructed. These parameters control the background colour, the splash screen icon, and the duration of the fade-out animation. The key settings are defined within your build script or your manifest resource files. Key properties include the splash screen background colour, which must match your web manifest, the splash screen icon resource, and the fade-out duration in milliseconds.

By default, modern TWA libraries use the Custom Tabs splash screen API. This API allows the browser to draw the splash screen image directly, ensuring that the transition from native UI to browser UI is completely smooth. If this is not configured correctly, the native splash screen is dismissed before the browser has finished painting the web page, resulting in a blank screen.

Comparing Splash Screen Settings across Platforms

To ensure perfect visual synchronization, use this comparative guide to map your web settings to their native counterparts:

Visual PropertyWeb App Manifest PropertyAndroid Wrapper Parameter
Background Colourbackground_colorgeneratorAppSplashBgColor
Theme/Status Bar Colourtheme_colorthemeColor
Application Iconicons (512x512 maskable)ic_launcher (mipmap drawable)
Fade Animation DurationDefined in custom CSS transitionssplashScreenFadeOutDuration

How to Minimise Browser Initialisation Delay

Matching colours is only half the battle. If your web application takes several seconds to load its initial paint, the user will be left staring at the splash screen for an uncomfortable amount of time, or the system may timeout the splash screen, leading to a blank screen. To prevent this, you must optimise your PWA for launch performance.

First, implement an aggressive caching strategy using your service worker. The service worker should cache the shell of your application, including critical CSS, core JavaScript, and the launch route. When the TWA launches, the browser should load these assets from the local cache instantly, rather than making a network request. This ensures that the First Contentful Paint is achieved in milliseconds, even on poor network connections.

Second, avoid loading non-essential third-party scripts during the initialisation phase. Script tags for analytics, customer support widgets, and advertising networks should be deferred or loaded asynchronously after the main application interface has rendered and become interactive.

Eliminating the White Flash in Custom TWA Builds

If you are using custom build scripts or configuring your TWA manually, you must verify that the androidx.browser.customtabs.TrustedWebActivityIntentBuilder is properly receiving the splash screen parameters. When the native intent is built, the splash screen configuration is passed as bundle metadata. This ensures that the Custom Tab provider knows to keep the splash screen visible until the first page paint signal is sent back by the browser.

If you observe a flash specifically on older Android devices, it is likely due to hardware performance limitations or older versions of Chrome. Ensure that your wrapper targets modern Custom Tabs library versions, which include robust backward compatibility workarounds for older rendering engines.

Testing the Launch Transition

To verify that your configuration is correct, you should test the launch transition under various network conditions. You can use Chrome DevTools remote debugging to inspect the launch sequence. Alternatively, use the Android Debug Bridge (ADB) to capture a screen recording of your app launching at 60 frames per second. By playing the recording back frame-by-frame, you can pinpoint the exact moment a visual mismatch or white frame occurs and adjust your colour values or cache settings accordingly.

Ready to ship your Android app?

Paste your PWA URL, get a signed APK and a Google Play ready AAB in minutes.

Build my app