android开启免提切换功能示例
时间:2023-07-13 06:42:28
以下代码实现了android的免提开启和关闭功能
需要添加的权限
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
/**
* 免提
*
* @param context
*/
private void toggleSpeaker(Context context)
{
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.setMode(AudioManager.MODE_IN_CALL);
am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
}
标签:android,免提
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
深入了解Spring中最常用的11个扩展点
2023-07-05 17:46:40
![](https://img.aspxhome.com/file/2023/1/57531_0s.png)
SpringMVC 参数绑定相关知识总结
2022-06-05 12:50:54
SpringBoot使用@ResponseBody返回图片的实现
2023-11-28 04:41:24
![](https://img.aspxhome.com/file/2023/4/60414_0s.jpg)
Java Swing中的文本框(JTextField)与文本区(JTextArea)使用实例
2022-08-15 00:17:46
![](https://img.aspxhome.com/file/2023/1/94221_0s.jpg)
浅谈java常量池
2023-11-18 09:43:50
详解用Spring Boot Admin来监控我们的微服务
2022-02-12 15:18:03
聊聊Java 中的线程中断
2021-05-31 02:04:30
使用IntelliJ IDEA 15和Maven创建Java Web项目(图文)
2023-08-26 07:10:15
![](https://img.aspxhome.com/file/2023/1/101941_0s.png)
C#给Word不同页面设置不同背景
2021-07-20 01:28:16
![](https://img.aspxhome.com/file/2023/4/116504_0s.png)
java加载properties文件的六种方法总结
2023-09-20 05:24:54
![](https://img.aspxhome.com/file/2023/9/64809_0s.png)
Android Dialog 动画实例详解
2022-10-22 22:24:29
java中LinkedList使用迭代器优化移除批量元素原理
2021-12-05 11:26:07
![](https://img.aspxhome.com/file/2023/0/66180_0s.png)
c#调用存储过程实现登录界面详解
2023-01-02 22:03:07
![](https://img.aspxhome.com/file/2023/5/80125_0s.gif)
c# 编写的简单飞行棋游戏
2022-12-05 05:10:59
![](https://img.aspxhome.com/file/2023/5/85735_0s.png)
C#获取每个年,月,周的起始日期和结束日期的方法
2023-11-11 20:53:45
简单了解JAVA public class与class区别
2023-11-15 23:59:26
![](https://img.aspxhome.com/file/2023/5/59675_0s.png)
C#实现学生成绩管理系统
2021-06-05 22:51:31
![](https://img.aspxhome.com/file/2023/4/98224_0s.jpg)
Android嵌套RecyclerView左右滑动替代自定义view
2023-03-27 14:51:17
![](https://img.aspxhome.com/file/2023/9/89549_0s.gif)
c# 关闭窗体时提示的小例子
2021-11-10 19:08:18
解答“60k”大佬的19道C#面试题(上)
2023-10-03 10:20:48