简体   繁体   中英

Android crash with translucent splash screen

I was tried to remove system white splash before actual splash screen on application start. I follow this topic: How To fix white screen on app Start up? and created translucent style for splash activity:

<style name="Splash" parent="@android:style/Theme.Translucent">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowDisablePreview">true</item>
    </style>

But at first launch after the installation, application crashed with the following unhandled exception:

E/AndroidRuntime: FATAL EXCEPTION: main
                                                                Process: ru.perekrestok.app, PID: 13791
                                                                java.lang.IllegalArgumentException: reportSizeConfigurations: ActivityRecord not found for: Token{5b77a38 null}
                                                                    at android.os.Parcel.readException(Parcel.java:1687)
                                                                    at android.os.Parcel.readException(Parcel.java:1636)
                                                                    at android.app.ActivityManagerProxy.reportSizeConfigurations(ActivityManagerNative.java:6844)
                                                                    at android.app.ActivityThread.reportSizeConfigurations(ActivityThread.java:2768)
                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2711)
                                                                    at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                    at android.os.Looper.loop(Looper.java:154)
                                                                    at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

After first launch application starts normally. Can I fix this behaviour? I'm using latest android support library, if this is important

Change you activity entry in manifest with this. This will remove the white splash( as the theme is translucent) & your actual splash will be visible.

<activity
    android:name=".SplashActivity"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    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>
</activity>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM