从昨天开始,当我收到推送通知时,我在 Android 4.2 上遇到问题,即使我没有将其设置为振动,它也需要权限
Notification notification = new Notification(icon, notificationItem.message, when);
notification.setLatestEventInfo(context, "App", notificationItem.message,
PendingIntent.getActivity(context, 0, intent, 0));
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_SOUND;
NotificationManager nm =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(notificationItem.notificationID, notification);
异常由 nm.notify 引发
我在两个不同的应用程序中遇到了这个问题,我从不修改代码