Android 安卓可以';t禁用蓝牙

Android 安卓可以';t禁用蓝牙,android,bluetooth,Android,Bluetooth,蓝莓已经用了很长时间了,它不能用了。当我禁用蓝牙时,一段时间后,它会自动打开。 错误打印信息: 05-05 06:28:25.814: E/BTIF_CORE(5554): btif_disable_bluetooth : not yet enabled 05-05 06:28:33.819: E/BluetoothAdapterState(5554): Error disabling Bluetooth 05-05 06:28:33.855: E/PRX(628): hard code ser

蓝莓已经用了很长时间了,它不能用了。当我禁用蓝牙时,一段时间后,它会自动打开。 错误打印信息:

05-05 06:28:25.814: E/BTIF_CORE(5554): btif_disable_bluetooth : not yet enabled
05-05 06:28:33.819: E/BluetoothAdapterState(5554): Error disabling Bluetooth
05-05 06:28:33.855: E/PRX(628): hard code service registered.
05-05 06:28:33.874: E/BluetoothServiceJni(5554): SOCK FLAG = 1 ***********************
05-05 06:28:33.874: E/(5554): btmtk_jsr82_session_service_registration@264:[JSR82][JBT] JSR82 does not init
05-05 06:28:33.874: E/BluetoothServiceJni(5554): Socket listen failed: 1
05-05 06:28:33.874: E/BluetoothAdapterService(1112665360)(5554): Failed to create socket channel
05-05 06:28:33.874: E/[MAP]BluetoothMapService(5554): [initSocket] Error create RfcommServerSocket java.io.IOException: Error: -1
05-05 06:28:33.922: E/BluetoothServiceJni(5554): SOCK FLAG = 1 ***********************
05-05 06:28:33.922: E/(5554): btmtk_jsr82_session_service_registration@264:[JSR82][JBT] JSR82 does not init
05-05 06:28:33.922: E/BluetoothServiceJni(5554): Socket listen failed: 1
05-05 06:28:33.923: E/BluetoothAdapterService(1112665360)(5554): Failed to create socket channel
05-05 06:28:33.923: E/BluetoothPbapService(5554): Error create RfcommServerSocket java.io.IOException: Error: -1
05-05 06:28:33.982: E/BluetoothReceiver(1042): [MMI][BluetoothReceiver.startService][start service [com.mediatek.bluetooth.AdvancedService]
05-05 06:28:33.994: E/BluetoothServiceJni(5554): SOCK FLAG = 0 ***********************
05-05 06:28:33.994: E/(5554): btmtk_jsr82_session_service_registration@264:[JSR82][JBT] JSR82 does not init
这是一只虫子


很烦人。启动该问题,以便谷歌进行修复。

您是否在自己制作的应用程序中关闭蓝牙功能?如果是这样,请发布代码,如果您的问题只发生在您的设备上,而不考虑应用程序,那么这个问题不是编程related@Dengshun尹:请发布你的代码。不要在我的应用中打开。但这个问题是应用在一段时间后运行。蓝牙继续在应用中重新启动。
BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
BluetoothAdapter to =  bluetoothManager.getAdapter();
isServiceRestart = true;
if(to.isEnabled()) {
    to.disable();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    to.enable();
} else if(!to.isEnabled()) {
    to.enable();
}