问题描述
public void EnableBluetooth() {
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (!bluetoothAdapter.isEnabled()) {
Intent enableBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBluetooth,REQUEST_ENABLE_BT);
}
}
但是,要启用位置信息,它会有所不同:
Intent intent1 = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent1);
它无需打开对话框,而是将您重定向到“设置”页面,在该页面中您必须轻击开关,然后单击“上一步”。是否有一种更优雅的还很简单的方式,要求用户通过对话框启用“位置”功能,就像使用蓝牙一样?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)