public class NotificationUtil { public static List idNotification = new ArrayList(); public static int iid; public static void showNotification(String uid, String title, String text) { iid++; NotificationManager notificationManager = (NotificationManager) CommonAppContext.sInstance.getSystemService(NOTIFICATION_SERVICE); Notification notification = null; Intent intent = new Intent(RouteUtil.MAIN); intent.putExtra("notifForm", true); intent.putExtra("uid", uid); PendingIntent resultPendingIntent = PendingIntent.getActivity( CommonAppContext.sInstance, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel mChannel = new NotificationChannel(iid + "", iid + "", NotificationManager.IMPORTANCE_HIGH); Log.i("
Android notification 适配不同版本
最新推荐文章于 2024-03-05 18:11:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)