有没有办法找到蓝牙可见性是否设置为“永不超时”#39;状态?
感谢。
答案 0 :(得分:0)
试试这个,
BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
if (ba.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE)
{
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0);
startActivity(discoverableIntent);
}
您还应确保已打开适配器。