我想让蓝牙可被发现,有没有办法,android允许我的应用程序这样做吗?
我已经找到了这个链接,但是我不知道我该怎么做。
[http://developer.android.com/reference/android/provider/Settings.System.html#BLUETOOTH_DISCOVERABILITY][1]发布于 2012-02-14 13:08:23
通过此代码,您的设备将在300秒内可被发现
if (mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivity(discoverableIntent);
}https://stackoverflow.com/questions/9271969
复制相似问题