34

In the google I/O presentation, google team says that we can disable the default splash screen. I want to do that but I couldn't find the way to do it.

Has anyone able to achieve this?

Later edit:

I misunderstood what speakers told in that video. It seems that you can only edit the default splash screen, not disabling it.

Rex Nihilo
  • 604
  • 2
  • 7
  • 16
Denis Coman
  • 379
  • 1
  • 3
  • 7
  • can you please mention the video link where Googlers mentioned disabling the starting splash screen? – Faiizii Awan Jun 11 '21 at 10:04
  • I haven't heard anything where they've said explicitly that you'll be able to disable the automatic splash screen. The closest thing I've heard is in [this video](https://www.youtube.com/watch?v=D2cU_itNDAI) where they say at least twice (around the 7-8 minute mark) that people who want to can substitute the automatic splashscreen for their own legacy splash screen implementation, without really going into any details on exactly how that's done. – Michael Jun 11 '21 at 11:16
  • I have an auth activity (declared as LAUNCHER) that leads to another main activity that _isn't_ a launcher, but it shows the new splash when I navigate to it. The API for it is quite small and the docs are pretty sparse. Opting out of it should be trivial but I don't see anything about it. – Conti Jun 11 '21 at 12:27
  • Michael yes. you are right. I misunderstood that. @FaiiziiAwan the link that Michael posted was the video I was referring about. It seems that it's my mistake – Denis Coman Jun 11 '21 at 13:33
  • Yes @Micheal, I also found that we can update the design and delay time of splash screen. It is designed to handle the app launch time. A well popular issue with android, since it vary from device to device. – Faiizii Awan Jun 14 '21 at 05:43
  • Seems like the only correct approach is to reduce your app start-up time to near zero via the tools Google provided. – Ali Has Jun 17 '22 at 19:21

7 Answers7

27

you can add this line:

          <item name="android:windowIsTranslucent">true</item>    

in your style.xml file before close style tag. it`s make your default android splash transparent!

Shokie Varun
  • 291
  • 3
  • 6
21

On Android 12, it's not possible to opt out of the splash screen. It is only possible to customize it: icon, window background, exit animation.

By default, the splash screen is shown from user touch until the first frame of your application is drawn, so to minimize the time during which the splash screen is shown, you can try to reduce the launch time of your application.

You can also implement you own exit animation so the transition from the splash screen to the app is more seamless.

If you previously used a dedicated SplashScreen Activity and want to keep that activity, then here is the workaround from official docs.

Vadim Caen
  • 1,526
  • 11
  • 21
  • I also searched a lot but it is only customizable. Did not find any disabling option so far. – Faiizii Awan Sep 22 '21 at 07:26
  • 17
    As an app developer, this really annoys me. Renders every splash screen I've created useless. – Kris Craig Jan 15 '22 at 00:18
  • 6
    I agree Kris, I find it largely pointless and limiting. Now, all apps will loose their distinctiveness for the benefit of some cheezy (and likely often poorly done) max 1 second animation appearing through, essentially, a relatively small hole. I honestly think its a step backwards. – Andrew S Jan 25 '22 at 05:10
  • An app launch should be as fast as possible, we should not let user wait on a splash screen just to show them a nice animation. If some authentication needs to be done, then creating a authentication screen, with a good fallback in case of missing network is better. Moreover, this new splash screen runs while the app process is created, so it hides the delay that was exisiting between touch and the app drawing. If one really need some animation, then it's possible to transition to a custom splash screen. [See my example](https://github.com/vcaen/splashscreen-sample/tree/main/lottiesample/) – Vadim Caen Jan 25 '22 at 09:38
  • It is now possible true – Vahit Keskin Apr 30 '23 at 14:27
10

Unfortunately, you cannot disable the default splash screen directly on Android 12 devices through the APIs they've provided.

If your app has a custom splash screen & you don't want to migrate to this new approach you can try the following hack.

Basically what you've to do is override your splash screen theme in res\values-v31\themes.xml & set a transparent icon.

<!-- My custom theme for splash screen activity -->
<style name="Theme.Splash" parent="Theme.Main">
    <item name="android:windowBackground">@color/background</item>
    <!-- Set a transparent .png as your icon -->
    <item name="android:windowSplashScreenAnimatedIcon">@drawable/transparent_image</item>
</style>

This will get you rid of the default app icon that appears during splash when the app is launch.

Dave Nottage
  • 3,411
  • 1
  • 20
  • 57
kaustubhpatange
  • 442
  • 5
  • 13
4

There is no direct API to disable the default splash screen but if we add <item name="android:windowIsTranslucent">true</item> to your style

<style name="Theme.RemoveSplashScreenTheme" parent="@style/BaseTheme">
    <item name="android:windowIsTranslucent">true</item>
</style>

And apply this to splash screen Activity.

<activity
        android:name="com.test.SplashScreenActivity"
        android:launchMode="singleInstance"
        android:theme="@style/Theme.RemoveSplashScreenTheme"
        android:noHistory="true" />

this will replace the default splash screen with a transparent screen. This workaround will eliminate the 2 splash screen issue if the app already has one.

  • 3
    The `android:theme` value in your latter `` element does not match the theme name from your ` – CommonsWare Jul 19 '21 at 12:49
  • 1
    @CommonsWare Thanks for the suggestion and updated my answer. Yes, it will make the system splash screen invisible and it may look like the app is not responding. If you are facing this issue then check the 2nd approach mentioned here https://stackoverflow.com/a/68430880/4730971. – Karthik Bollisetti Jul 20 '21 at 10:49
2

Disabling the default splash screen that was introduced in Android 12 is not straight-forward. In my opinion, the simplest approach is to modify the app styles.

In your app's values/styles.xml file, make sure you have a "BaseTheme" and an "AppTheme". For example:

<resources>
    <style name="BaseTheme" parent="Theme.AppCompat">
        <!-- [...] -->
    </style>

    <style name="AppTheme" parent="BaseTheme" />
</resources>

Then, in values-v31/styles.xml and more recent versions (e.g., v32), extend "BaseTheme" by adding these items:

<resources>
    <style name="AppTheme" parent="BaseTheme">
        <item name="android:windowSplashScreenAnimatedIcon">@android:color/transparent</item>
        <item name="android:windowSplashScreenAnimationDuration">0</item>
    </style>
</resources>

That way, the default splash screen will be blank, having the background color inherited from "BaseTheme".

josemmo
  • 6,523
  • 3
  • 35
  • 49
0

The default splash screen is only visible when your app take time to draw its first frame. You can try to reduce the launch time of your application to prevent the slash screen visibility.

Disable the default splash screen is not possible but you can apply the patch to prevent it from the visibility and show your own old customised splash screen.

  1. Customise splash screen to make it transparent:

    <style name="Theme.App.Starting" parent="Theme.SplashScreen">
        <item name="windowSplashScreenBackground">@color/transparent</item>
        <item name="windowSplashScreenAnimatedIcon">@drawable/transparent</item>
        <item name="postSplashScreenTheme">@style/AppTheme</item>
    </style>
    

    Here you need to set your app theme in postSplashScreenTheme

  2. Add splash screen theme to your launcher activity:

    <activity android:theme="@style/Theme.App.Starting">
    
  3. Install splash screen in your launcher activity before the super.onCreate of your onCreate method:

    SplashScreen.installSplashScreen(this);
    

Done!

Note: I am using AppTheme at my application level and add transparent theme in launcher activity only. Also adding AppTheme in splash screen theme with postSplashScreenTheme property.

SANAT
  • 8,489
  • 55
  • 66
-1

Add "android:windowSplashScreenAnimatedIcon" in your Splash theme

<style name="SplashTheme" parent="AppMaterialTheme">
    <item name="android:windowBackground">@drawable/bg_splash</item>
    <item name="android:windowSplashScreenAnimatedIcon">@android:color/transparent</item>

And apply this to your Splash activity

<activity
        android:name=".view.ui.splash.SplashActivity"
        android:enabled="true"
        android:exported="true"
        android:screenOrientation="portrait"
        android:theme="@style/SplashTheme">
AMAL K G
  • 306
  • 1
  • 7