有人用链琕OID beats耳机链接电脑吗

链瑅oid rgb7.1耳机怎么样_百度知道
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。
链瑅oid rgb7.1耳机怎么样
我有更好的答案
选择适合自己的就可以了,可以多试听一下,不同的听觉听出来的音效是不同的,最好自己听一下比较好,别人说的好也不一定适合自己的耳机的音质怎么样
采纳率:93%
来自团队:
为您推荐:
您可能关注的内容
换一换
回答问题,赢新手礼包有人用过链琕OID天行者吗?这耳机怎么样_百度知道
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。
有人用过链琕OID天行者吗?这耳机怎么样
为您推荐:
换一换
回答问题,赢新手礼包I'm developing an application that has the following requisite: If there is a headset plugged in the device and the user removes it, I need to mute all streams. To do that I need to listen to the AudioManager.ACTION_AUDIO_BECOMING_NOISY Broadcast. This is ok! Not problem here.
But when the user plugs the headset again, I need to un-mute the device. But there isn't a AudioManager.ACTION_AUDIO_BECOMING_NOISY opposite broadcast. I cannot know when the headset is plugged again.
One solution is to periodically see if AudioManager.isWiredHeadsetOn() is true but this don't appear to be a good solution to me.
Is there a way to detect when the user plugs a headset on the device?
Edited: I tried to use Intent.ACTION_HEADSET_PLUG this way, but it didn't work.
In the manifest.xml I put:
&receiver android:name=".MusicIntentReceiver" &
&intent-filter&
&action android:name="android.intent.action.HEADSET_PLUG" /&
&/intent-filter&
&/receiver&
And here is the code of my MusicIntentReceiver.java:
public class MusicIntentReceiver extends BroadcastReceiver {
public void onReceive(Context ctx, Intent intent) {
AudioManager audioManager = (AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE);
if (intent.getAction().equals(Intent.ACTION_HEADSET_PLUG)) {
Log.d("Let's turn the sound on!");
//other things to un-mute the streams
Any other solution to try?
解决方案 How about this call:
which I found at
The updated code I see in your question now isn't enough. That broadcast happens when the plugged state changes, and sometimes when it doesn't, according to
so I would write:
package com.example.
import android.os.B
import android.app.A
import android.content.BroadcastR
import android.content.C
import android.content.I
import android.content.IntentF
import android.util.L
public class MainActivity extends Activity
private static final String TAG = "MainActivity";
private MusicIntentReceiver myR
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myReceiver = new MusicIntentReceiver();
@Override public void onResume() {
IntentFilter filter = new IntentFilter(Intent.ACTION_HEADSET_PLUG);
registerReceiver(myReceiver, filter);
super.onResume();
private class MusicIntentReceiver extends BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_HEADSET_PLUG)) {
int state = intent.getIntExtra("state", -1);
switch (state) {
Log.d(TAG, "Headset is unplugged");
Log.d(TAG, "Headset is plugged");
Log.d(TAG, "I have no idea what the headset state is");
@Override public void onPause() {
unregisterReceiver(myReceiver);
super.onPause();
The AudioManager.isWiredHeadsetOn() call which I earlier recommended turns out to be deprecated since API 14, so I replaced it with extracting the state from the broadcast intent. It's possible that there could be multiple broadcasts for each plugging or unplugging, perhaps because of contact bounce in the connector.
本文地址: &
我正在开发具有以下所需的应用程序:如果插在设备中的耳机和用户删除它,我需要静音所有流。要做到这一点,我需要听 AudioManager.ACTION_AUDIO_BECOMING_NOISY 广播。这是确定的!没有问题就在这里。
但是,当用户的插头的耳机再次,我需要取消静音的设备。但是,没有一个 AudioManager.ACTION_AUDIO_BECOMING_NOISY 对面的广播。我不知道耳机再次插入时。
解决方案之一是定期查看是否 AudioManager.isWiredHeadsetOn()是真,但这似乎并没有是一个很好的解决方案给我。
有没有一种方法,当用户插入设备上的耳机来检测?
编辑:我试图用 Intent.ACTION_HEADSET_PLUG 这样一来,但没有奏效
在我把manifest.xml的:
<接收机器人:名称=“。MusicIntentReceiver”>
<意向滤光器&
&作用机器人:名称=“android.intent.action.HEADSET_PLUG”/>
&所述; /意图滤光器&
< /接收器>
这里是的code我的 MusicIntentReceiver.java :
公共类MusicIntentReceiver扩展的BroadcastReceiver {
公共无效的onReceive(上下文CTX,意图意图){
AudioManager audioManager =(AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE);
如果(intent.getAction()。等于(Intent.ACTION_HEADSET_PLUG)){
Log.d(“让我们把声音开!”);
//其他的事情要取消静音的流
任何其他的解决方案来试试呢?
解决方案 这个怎么样的呼叫:
/reference/android/content/Intent.html#ACTION_HEADSET_PLUG
我发现,在
更新code现在我在你的问题中看到的是不够的。的广播发生堵塞的状态发生改变时,有时当它不存在,按照Intent.ACTION_HEADSET_PLUG活动开始时,收到所以我会写:
包com.example.
进口android.os.B
进口android.app.A
进口android.content.BroadcastR
进口android.content.C
进口android.content.I
进口android.content.IntentF
进口android.util.L
公共类MainActivity延伸活动{
私有静态最后字符串变量=“MainActivity”;
私人MusicIntentReceiver myR
@覆盖保护无效的onCreate(包savedInstanceState){
super.onCreate(savedInstanceState);
的setContentView(R.layout.activity_main);
myReceiver =新MusicIntentReceiver();
@覆盖公共无效onResume(){
IntentFilter的过滤器=新的IntentFilter(Intent.ACTION_HEADSET_PLUG);
registerReceiver(myReceiver,过滤器);
super.onResume();
私有类MusicIntentReceiver扩展的BroadcastReceiver {
@覆盖公共无效的onReceive(上下文的背景下,意图意图){
如果(intent.getAction()。等于(Intent.ACTION_HEADSET_PLUG)){
INT状态= intent.getIntExtra(“国家”,-1);
开关(州){
Log.d(TAG,“耳机是不插电”);
Log.d(TAG,“耳机插入”);
Log.d(TAG,“我不知道什么耳机状态”);
@覆盖公共无效的onPause(){
unregisterReceiver(myReceiver);
super.onPause();
在AudioManager.isWiredHeadsetOn()调用我建议早些时候原来是因为API 14 pcated德$ P $,所以我从广播意图提取状态取代了它。这是可能的,有可能是多个节目的每个插入或拔出,或许是因为触点抖动,在连接。
本文地址: &
扫一扫关注官方微信}

我要回帖

更多关于 win10 链接蓝牙耳机 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信