0
每次在我的android應用程序啓動有一個白色的窗口幾秒鐘。我在我的應用程序中有一個啓動畫面,我想要顯示而不是此白色屏幕。我已經將windowDisablePreview設置爲true,但它不起作用。如何解決這個問題。
真正無法隱藏android啓動與android的白色窗口:windowDisablePreview
Android清單
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ankitsrivastava.recyclerview">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!--Splash Screen-->
<activity
android:name=".app.SplashScreen"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--Main Activity-->
<activity android:name=".app.MainActivity">
</activity>
</application>
Styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- 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:windowDisablePreview">true</item>
</style>
檢查你是否正在加載一個大的圖像作爲背景飛濺或你正在做onCreate/onResume飛濺一些重任務。將其放入PostDelayed或稍後加載。 – Naeem