我在我的IntentService中构建了一个后栈.我收到了Kitkat设备的崩溃报告.
我的代码很简单,我不知道是什么原因.我有一个堆栈跟踪,但它没有让我到任何地方.有人经历过这样的事吗?
override fun onHandleIntent(intent: Intent?) { if (intent != null) { val articleIntent = intentFor<ArticleActivity>() articleIntent.putExtras(intent) TaskStackBuilder.create(this).addNextIntent(intentFor<DrawerActivity>()).addNextIntent(articleIntent).startActivities() } }
Crashlytics的例外情况
java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1471) at android.os.Parcel.readException(Parcel.java:1419) at android.app.ActivityManagerProxy.startActivities(ActivityManagerNative.java:4473) at android.app.Instrumentation.execStartActivitiesAsUser(Instrumentation.java:1496) at android.app.ContextImpl.startActivitiesAsUser(ContextImpl.java:1417) at android.content.ContextWrapper.startActivitiesAsUser(ContextWrapper.java:356) at android.app.TaskStackBuilder.startActivities(TaskStackBuilder.java:221) at android.app.TaskStackBuilder.startActivities(TaskStackBuilder.java:232) at android.app.TaskStackBuilder.startActivities(TaskStackBuilder.java:208) at se.omni.gcm.OpenArticleService.onHandleIntent(OpenArticleService.kt:27) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.os.HandlerThread.run(HandlerThread.java:61)
解决方法
我刚刚在SO
TaskStackBuilder#startActivities() NullPointerException上找到了类似的问题,答案让我满意.自从我开始赏金以来,我无法关闭或删除这个问题.