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

2025年03月12日 15:26
有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):

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