Why does the screen appear for 1 second when launching applications on Android?

When I click the application icons and launch the applications, a white screen will appear on the screen for 1 second.
I do not know why. Is there any idea to clear this white screen and go straight to my work?

+4
android
Sep 27 '12 at 2:26
source share
9 answers

white / black screen is the background of the image window.

The background of the window is displayed during, for example. your onCreate() works and your layouts are bloated. This can take some time, especially if there are many bitmaps that need to be read, decoded, and scaled.

Changing the theme works because some themes have a custom window background. For example, Theme.Wallpaper has a transparent background . There are other definitions. Essentially you want:

 <style name="YourTheme"> <item name="android:windowBackground">@null</item> </style> 

Programmatically, you can achieve the same result with

 getWindow().setBackgroundDrawable(null); 

at the top of the onCreate() action.

(An old question, but came across a different answer, and there was no good answer.)

+9
Jan 15 '14 at 8:23
source share

Settings File> Settings> Build, Deploy> Instant Start Uncheck all the options available there.

and add the line below to your style.xml

  <item name="android:windowDisablePreview">true</item> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowFullscreen">true</item> <item name="android:windowDisablePreview">true</item> </style> apply changes in AndroidMainfest.xml <application android:theme="@style/AppTheme"> 
+4
Jun 27 '16 at 13:09 on
source share

After changing style.xml:

 <resources> <style name="AppTheme" parent="android:Theme.Wallpaper" /> </resources> 

it works!! Thanks everyone

+3
Sep 27
source share

Add the following to the manifest file of the appropriate action:

  android:launchMode="standard" 

and remove android: label = "@ string / app_name" from the corresponding action, it really helped me

+1
Sep 10 '14 at 6:25
source share

In your manifest.xml file, delete the line android:theme="@style/AppTheme" for your application. and check it again

0
Sep 27 '12 at 3:10
source share

Use this tag in the manifest:

 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
0
May 16 '14 at 5:02
source share

Just specify a transparent theme for the initial activity in the AndroidManifest.xml file.

how

 <activity android:name="first Activity Name" android:theme="@android:style/Theme.Translucent.NoTitleBar" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> 

0
Feb 11 '16 at 9:02
source share

enter image description here Like you, the pipe. First they show the icon screen instead of the white screen. And after 2 seconds it shows the initial screen.

first create an XML drawing in res / drawable.

 <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/gray"/> <item> <bitmap android:gravity="center" android:src="@mipmap/ic_launcher"/> </item> </layer-list> 

Then you set this as the background splash effect in the theme. Browse to the styles.xml file and add a new theme for your splash activity.

 <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> </style> <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> <item name="android:windowBackground">@drawable/background_splash</item> </style> </resources> 

In the new SplashTheme, set the window background attribute for your XML resource. Configure this as a burst activity theme in your AndroidManifest.xml:

 <activity android:name=".SplashActivity" android:theme="@style/SplashTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

This link gives what you want. step by step procedure. https://www.bignerdranch.com/blog/splash-screens-the-right-way/

0
Nov 08 '16 at 8:58
source share

In Styles add the following things

  <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> 

Hope this helps you and his work for me

0
Jun 12 '19 at 8:02
source share



All Articles