当前位置:首页 > 笔记 > 正文内容

Notification 8.0 关闭声音震动

jsc8年前 (2018-04-27)笔记8290

NotificationChannel notificationChannel = new NotificationChannel

                    (NOTIFICATION_CHANNEL_ID, "Test Notifications", NotificationManager.IMPORTANCE_LOW);

//Configure the notification channel, NO SOUND

notificationChannel.setDescription("no sound");

notificationChannel.setSound(null,null); <---- ignore sound

notificationChannel.enableLights(false);

notificationChannel.setLightColor(Color.BLUE);

notificationChannel.enableVibration(false);

需要卸载app重新安装否则不生效

扫描二维码推送至手机访问。

版权声明:本文由微小站发布,如需转载请注明出处。

本文链接:https://www.jsc0.com/post/153.html

标签: 通知栏相关
分享给朋友:

“Notification 8.0 关闭声音震动” 的相关文章

java类型

最近在写Java后台, 编译时出现:No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instance of type E(e.g.  x.new...

百度坐标和GPS坐标转换

百度地图API中,有GPS坐标转百度坐标的功能http://dev.baidu.com/wiki/static/map/API/examples/?v=1.2&0_6#0&6http接口是:http://api.map.baidu.com/ag/coord/convert?from=...

关于初学者上传文件到github的方法

关于初学者上传文件到github的方法

【第一步】建立先仓库  第一步的话看一般的提示就知道了,在github新建一个repository(谷歌可以解决),都是可视化的界面操作,所以难度不大。或者看这里:https://help.github.com/articles/create-a-repo 这是官方help,虽然是英文的,...

百度地图被外部调用的问题

选择手机里安装的外部地图应用,在外部地图应用里显示商户的位置。Uri mUri = Uri.parse("geo:39.922840,116.3543240?q=39.922840,116.3543240(北京市西城区阜外大街2号万通大厦)");Intent mIntent =...

TabLayout getCustomView为空的问题

今天用Tablayout——ViewPage出现getCustomView为空的问题通过源码发现,ViewPage的adapter更新会吧TabLayout  的customViewc置空。这个时候自动调用OnTabSelectedListener的onTabSelected方法去获取Cu...