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

Notification 8.0 关闭声音震动

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

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 关闭声音震动” 的相关文章

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

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

viewpager、listview、gridview、scrollview去除蓝色阴影

xml:   android:overScrollMode="never"java:    view.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);...

TabLayout getCustomView为空的问题

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

Manifest merger failed with multiple errors, see logs

在android开发的时候,有时候会遇到这样的问题Error:Executionfailedfortask':test:processDebugManifest'.>Manifestmergerfailedwithmultipleerrors,seelogs但是要命的是,除了这...

ERROR: Failed to create toolchain.

哔哩哔哩视频编译报错build on Darwin x86_64ANDROID_NDK=/Users/sampeng/export/android-sdk-macosx/ndk-bundleIJK_NDK_REL=15.0.4075724NDKr15.0.4075724 detectedHOST_O...