标签:create imp and int 系统 bsp lse oid code
final String CHANNEL_ID = "channel_id_1"; final String CHANNEL_NAME = "channel_name_1"; NotificationManager mManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification.Builder builder = null; if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O){ builder = new Notification.Builder(this); }else{ NotificationChannel notificationChannel = new NotificationChannel(Config.CHANNEL_ID, Config.CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH); //如果这里用IMPORTANCE_NOENE就需要在系统的设置里面开启渠道, //通知才能正常弹出 mManager.createNotificationChannel(notificationChannel); builder = new Notification.Builder(this,Config.CHANNEL_ID); } notification = builder.build(); mManager.notify(555, notification);
标签:create imp and int 系统 bsp lse oid code
原文地址:https://www.cnblogs.com/rchao/p/9057473.html