android实现来电静音示例(监听来电)
时间:2021-09-23 09:43:48
private static int previousMuteMode = -1;
/**
* 来电静音
*
* @param context
*/
private void toggleRingerMute(Context context)
{
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
if (previousMuteMode == -1)
{
previousMuteMode = am.getRingerMode();
am.setRingerMode(0);
}
am.setRingerMode(previousMuteMode);
previousMuteMode = -1;
}
标签:android,静音
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java Mybatis框架Dao层的实现与映射文件以及核心配置文件详解分析
2021-06-15 16:29:22
![](https://img.aspxhome.com/file/2023/7/61587_0s.png)
提升java开发效率工具lombok使用争议
2022-06-22 03:08:18
![](https://img.aspxhome.com/file/2023/9/104069_0s.jpg)
Java实现按行读取大文件
2022-11-05 13:56:57
spring cloud gateway中如何读取请求参数
2021-08-19 16:19:02
![](https://img.aspxhome.com/file/2023/7/84217_0s.png)
myBatis组件教程之缓存的实现与使用
2023-09-24 00:49:18
![](https://img.aspxhome.com/file/2023/0/113460_0s.jpg)
Java实现24点小游戏
2023-07-26 07:34:55
![](https://img.aspxhome.com/file/2023/6/63336_0s.png)
android电源信息查看(电量、温度、电压)实例代码
2022-04-30 15:41:04
C# 文件下载之断点续传实现代码
2021-05-24 15:37:02
C#双向链表LinkedList排序实现方法
2021-08-19 14:06:16
![](https://img.aspxhome.com/file/2023/9/113789_0s.png)
java信号量控制线程打印顺序的示例分享
2023-05-09 12:27:38
SpringBoot集成Redisson实现分布式锁的方法示例
2021-10-30 16:59:38
![](https://img.aspxhome.com/file/2023/8/83488_0s.jpg)
Android Scroller大揭秘
2023-05-20 07:07:46
![](https://img.aspxhome.com/file/2023/7/137377_0s.png)
mybatis的if判断integer问题
2022-12-23 20:15:41
Struts2实现多文件上传功能
2021-11-01 13:50:25
![](https://img.aspxhome.com/file/2023/8/69098_0s.png)
SpringBoot 项目中创建线程池
2023-09-21 22:12:04
SpringBoot启动yaml报错的解决
2021-09-09 22:58:14
![](https://img.aspxhome.com/file/2023/9/69089_0s.png)
详解spring security之httpSecurity使用示例
2023-08-03 09:46:17
安卓版微信小程序跳一跳辅助
2022-08-30 13:44:20
![](https://img.aspxhome.com/file/2023/4/109194_0s.jpg)
Java monitor机制使用方法解析
2023-11-09 11:25:56
![](https://img.aspxhome.com/file/2023/3/58563_0s.png)
C#三种方法获取文件的Content-Type(MIME Type)
2022-05-28 16:57:27