我在我的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)
答案 0 :(得分:5)
我刚刚在SO TaskStackBuilder#startActivities() NullPointerException上找到了类似的问题,答案让我满意。自从我开始赏金以来,我无法关闭或删除这个问题。