我没有进行任何更改,但是Android 8-9-10一直开始收到此错误。
Fatal Exception: java.lang.RuntimeException
android.os.DeadSystemException
android.app.NotificationManager.notifyAsUser + 330 (NotificationManager.java:330)
android.app.NotificationManager.notify + 280 (NotificationManager.java:280)
com.trkstudio.ezanvakti.WidgetService.updateWidget + 57 (WidgetService.java:57)
com.trkstudio.ezanvakti.WidgetService.access$000 (WidgetService.java)
com.trkstudio.ezanvakti.WidgetService$ExampleRunnable.run + 35 (WidgetService.java:35)
java.lang.Thread.run + 764 (Thread.java:764)
我想这是我从错误中得到的代码行
WidgetService.java:57 = startForeground(id, getWidgetNotification(allMyTime, dateOfDay));
// getWidgetNotification()
return new NotificationCompat.Builder(context, CHANNEL_ID)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCustomContentView(remoteViews)
.setContentIntent(widgetIntent)
.setSmallIcon(smallIcon)
.setOnlyAlertOnce(true)
.setAutoCancel(false)
.setContentTitle("")
.setContentText("")
.setPriority(33)
.setWhen(when)
.build();