我在应用程序中添加了新功能以显示应用程序内消息活动。但是当启动画面正在加载时,它的展示活动和启动画面将在几秒钟内消失。所以应用程序会引发崩溃。
这是崩溃日志:
Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:894)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:109)
at com.google.firebase.inappmessaging.display.internal.FiamWindowManager.show(Unknown Source)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$5.onSuccess(Unknown Source)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.loadNullableImage(Unknown Source)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.inflateBinding(Unknown Source)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.access$400(Unknown Source)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$2.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
那么如何防止停止显示特定活动的应用内消息活动?