是否有办法找到蓝牙可见性是否设置为'从不超时'状态?
谢谢。
试试这个,
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);
}
你还应该确保适配器是打开的