星海人才网,瑜媞,天堂伞官方旗舰店
mnotifymgr = (notificationmanager) getsystemservice(notification_service);
mnotifymgr.cancelall();
string title = getstring(r.string.filtershow_notification_label); if(build.version.sdk_int >= build.version_codes.o) { string id = "channel_1"; notificationchannel channel = new notificationchannel(id, title, notificationmanager.importance_high); mnotifymgr.createnotificationchannel(channel); mbuilder = new notification.builder(this, id) .setcategory(notification.category_event) .setsmallicon(r.drawable.filtershow_button_fx) .setcontenttitle(title) .setcontenttext(getstring(r.string.filtershow_notification_message)) .setautocancel(true); } else { mbuilder = new notification.builder(this) .setsmallicon(r.drawable.filtershow_button_fx) .setcontenttitle(title) .setcontenttext(getstring(r.string.filtershow_notification_message)); }
mnotifymgr.notify(mnotificationid, mbuilder.build());
mnotificationid为1的话,systemui下拉栏会存在对应的通知item(可以用来点击跳转),
如果是0的话,则不会出现.
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android apk 项目一键打包并上传到蒲公英的实现方法
Android 自定义LineLayout实现满屏任意拖动功能的示例代码
android 限制某个操作每天只能操作指定的次数(示例代码详解)
Android 集成 google 登录并获取性别等隐私信息的实现代码
网友评论