DEV Community

Cover image for Adding Splash Screen to Trusted Web Activity with Android’s FileProvider

Adding Splash Screen to Trusted Web Activity with Android’s FileProvider

Henry Lim on May 03, 2019

⚠️ THIS ARTICLE IS MORE THAN 1 YEAR OLD. Please refer to this article on how to add splash screen to Trusted Web Activities. Learn how you ca...
Collapse
 
jacobdb profile image
Jacob Bearce

How would I change the background color for the splash screen?

Collapse
 
masoudmsk profile image
Masoud Salehi

Add this to the manifest after SPLASH_IMAGE_DRAWABLE:

<meta-data
    android:name="android.support.customtabs.trusted.SPLASH_SCREEN_BACKGROUND_COLOR"
    android:resource="@color/backgroundColor" />
Enter fullscreen mode Exit fullscreen mode
Collapse
 
1998chun profile image
1998chun

Do anyone knows how?

Collapse
 
wesleywaihk profile image
wesleywaihk • Edited

I do not succeed, the app keeps force quitting on all of my devices.

It seems to be a custom-tabs-client issue.

I was using d08e93fce3 and it is fine.

but I tried 809a55c which is the latest, 700d2e1 and 3679335, all makes the app crash.

There is my code:
github.com/wesleywaihk/weschat-and...

Collapse
 
wesleywaihk profile image
wesleywaihk

in the provider tag, android.support.v4.content.FileProvider is now deprecated.

We may use androidx.core.content.FileProvider instead

ref: stackoverflow.com/questions/485342...

Collapse
 
revaaasai profile image
Revaaasai

It is working with white background with logo .I need to change the white background .How to change the white background in the splash screen?

Collapse
 
masoudmsk profile image
Masoud Salehi

Add this to the manifest after SPLASH_IMAGE_DRAWABLE:

<meta-data
    android:name="android.support.customtabs.trusted.SPLASH_SCREEN_BACKGROUND_COLOR"
    android:resource="@color/backgroundColor" />
Enter fullscreen mode Exit fullscreen mode