Android crash with translucent splash screen
Asked Answered
N

1

14

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

Nurmi answered 21/11, 2016 at 12:52 Comment(4)
post your main activity codePleuro
I was trying to comment out all, except setContentView, but result was same: pastebin.com/CNj5ABJPNurmi
@Nurmi were you able to resolve this?Ramin
@PravinSonawane no, I have to revert to non-translucent startup screenNurmi
C
0

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>
Consueloconsuetude answered 27/7, 2017 at 12:49 Comment(4)
Unable to start activity ComponentInfo{myapp.app.screens.SplashActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. Maybe there are AppCompat analogue of this themeNurmi
Can you pls share your splash activity.Consueloconsuetude
@Nurmi I think you are using ActionBarActivity or like that to extend your activity & this theme can be used only if you extend with AppCompatActivityConsueloconsuetude
I'm using appcompat activity, so, maybe, this is the cause. I will post code of activity todayNurmi

© 2022 - 2024 — McMap. All rights reserved.