android中怎样判断蓝牙是否连接

2025-03-12 15:26:57
推荐回答(3个)
回答1:

一般顶部都有图标的,另外可以到设置通信里面查找

回答2:

private void handleHeadsetStateChange()
{
Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG);
if(BluetoothProfile.STATE_CONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET))
{
intent.putExtra("state", 1);
intent.putExtra("microphone", 1);
mContext.sendBroadcast(intent);
}
else if(BluetoothProfile.STATE_DISCONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET))
{
intent.putExtra("state", -1);
mContext.sendBroadcast(intent);
}
}

回答3:

多久发货好玩的事活动结束的话就会受到地方儿的法国代购费