pf
pf
  • 发布:2020-12-14 19:03
  • 更新:2020-12-18 21:25
  • 阅读:205

#插件讨论# 【 XZH-musicNotification - xzh 】点击两次安卓返回键后,启动 app 闪退,必现!

分类:uni-app

com.xzh.musicnotification.service.PlayServiceV2@e15dca4 with null: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.Serializable android.content.Intent.getSerializableExtra(java.lang.String)' on a null object reference
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4179)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.app.ActivityThread.-wrap21(Unknown Source:0)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2119)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:108)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.os.Looper.loop(Looper.java:166)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7529)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.Serializable android.content.Intent.getSerializableExtra(java.lang.String)' on a null object reference
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at com.xzh.musicnotification.service.PlayServiceV2.onStartCommand(PlayServiceV2.java:61)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4151)
12-14 18:39:16.453 24150 24150 E AndroidRuntime: ... 8 more

2020-12-14 19:03 负责人:无 分享
已邀请:
xzh

xzh

已处理了,有需要的,可以下载测试

xzh

xzh

我已经调整这里的传值方式了。现在使用方法传值了,不再使用 Intent、Serializable 进行传值,应该不会出现该bug。

要回复问题请先登录注册