Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Android 12 default splash screen

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.

like image 761
Denis Coman Avatar asked Jun 10 '21 13:06

Denis Coman


3 Answers

On Android 12, it's not possible to opt out of the splash screen. It' 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 SplashScreenActivity and want to keep that activity, then here is the workaround from official docs.

like image 50
Vadim Caen Avatar answered Oct 22 '22 15:10

Vadim Caen


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.

like image 37
kaustubhpatange Avatar answered Oct 22 '22 15:10

kaustubhpatange


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!

like image 1
Shokie Varun Avatar answered Oct 22 '22 15:10

Shokie Varun