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

Notification 8.0 关闭声音震动

jsc7年前 (2018-04-27)笔记7742

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://jsc0.com/post/153.html

标签: Notification
分享给朋友:

“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=...

Bitmap too large to be uploaded into a texture

从手机相册里面显示图片,但是发现有的图片能显示有的图片不能显示,路径都是对的,程序也没提示任何错误。后来通过看日志发现error message: Bitmap too large to be uploaded into a texture (4208x3120, max=4096x409...

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

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

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

equals和==区别

对于==,如果作用于基本数据类型的变量,则直接比较其存储的 “值”是否相等;    如果作用于引用类型的变量,则比较的是所指向的对象的地址对于equals方法,注意:equals方法不能作用于基本数据类型的变量    如果没有对equals方法进行重写,则比较的是引用类型的变量所指向的对象的地址; ...