Mak*_*aev 10 android android-notifications android-mediaplayer xiaomi android-notification.mediastyle
在没有任何明显原因的情况下,搭载 Android 11 的小米手机开始出现在 crashlytics 日志中。通知发生了一些事情。我们不会做任何太具体的事情,并且在其他 Android 11 设备上一切正常。我无法在受影响的设备上重现此崩溃。可能是什么原因?
第一次崩溃开始出现在 12 月初,并且到 1 月份,数量从每天 10 起迅速增长到 100+
碰撞:
Fatal Exception: android.app.RemoteServiceException
Bad notification(tag=null, id=) posted from package my.application, crashing app(uid=, pid=): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$MediaStyle cannot be cast to android.app.Notification$MessagingStyle
Run Code Online (Sandbox Code Playgroud)
通知样式:
final MediaStyle style = new MediaStyle()
.setMediaSession(token)
.setShowActionsInCompactView(PREV_POSITION, PLAY_PAUSE_POSITION, NEXT_POSITION)
.setCancelButtonIntent(STOP.notificationPending(mContext))
.setShowCancelButton(true);
setStyle(style);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
577 次 |
| 最近记录: |