gpt4 book ai didi

phone bluetooth on still asking turn on bluetooth in android(手机蓝牙打开仍要求在安卓系统中打开蓝牙)

转载 作者:bug小助手 更新时间:2023-10-25 15:05:51 29 4
gpt4 key购买 nike



Hi in the below code already phone bluetooth on still it is asking me to turn on the pop-up in the below code.

嗨,在下面的代码中,已经打开了蓝牙电话,但它仍然要求我打开下面代码中的弹出窗口。


Can any one help me where I did the wrong.

谁能帮帮我,我哪里做错了。


public void checkPermissionOffline(Activity activity, String value) {
Log.d("value jyothi", value);
if (bleAdapter == null) {
final BluetoothManager bluetoothManager = (BluetoothManager) activity.getSystemService(Context.BLUETOOTH_SERVICE);
bleAdapter = bluetoothManager.getAdapter();
}
if (value != null && value.equals(String.valueOf(Constant.BLE_DISABLED))) {
requestBluetoothEnable(activity);
} else {
if (!bleAdapter.isEnabled()) {
bluetoothPermissionResult(Constant.BLE_ENABLED);
Toast.makeText(activity,"ble enabled",Toast.LENGTH_LONG).show();
} else {
bluetoothPermissionResult(Constant.BLE_DISABLED);
Toast.makeText(activity,"ble disabled",Toast.LENGTH_LONG).show();
if (bleAdapter != null && bleAdapter.isEnabled()) {
if (!hasLocationPermissions(activity)) {
Log.e(TAG, "Enphase app requesting location permission");
Timber.tag("PES").i("Enphase app requesting location permission");
requestLocationPermission(activity);
} else {

Log.e(TAG, "Enphase app requesting DeviceLocation permission");
Timber.tag("PES").i("Enphase app requesting DeviceLocation permission");
requestDeviceLocationSettings(activity);
}
} else {
requestBluetoothEnableTesting(activity);
}
}
}
}

permission no need to ask already bluetooth is on

允许没有必要问已经蓝牙是


更多回答

Welcome to Stack Overflow. Line 10 of your source code contains an error.

欢迎来到Stack Overflow。源代码的第10行包含一个错误。

优秀答案推荐
更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com