Buscando Bluetooth cerca en 6.0.1

Estoy trabajando con una aplicación que busca cerca de bluetooth. Yo uso los siguientes códigos, funciona encontrar en 5.0 devuelve dispositivos bluetooth cerca pero cuando pruebo en 6.0.1 BluetoothDevice.ACTION_FOUND no se llama, sólo se llaman BluetoothAdapter.ACTION_DISCOVERY_STARTED y BluetoothAdapter.ACTION_DISCOVERY_FINISHED .

 @Override protected void onCreate(Bundle savedInstanceState) { BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,0); startActivity(discoverableIntent); } private final BroadcastReceiver bReciever = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); System.out.println(action); if (BluetoothDevice.ACTION_FOUND.equals(action)) { BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); System.out.println(device); } } }; public void onSearch(View v){ if (bluetoothAdapter.isDiscovering()) { bluetoothAdapter.cancelDiscovery(); } System.out.println(bluetoothAdapter.startDiscovery()); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(BluetoothDevice.ACTION_FOUND); intentFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED); intentFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); registerReceiver(bReciever, intentFilter); } 

Mi pregunta es ¿Por qué no se llamó BluetoothDevice.ACTION_FOUND en 6.0.1? Gracias.

¿Comprobó el permiso en el Administrador de aplicaciones?

Ir a " Configuración " -> " Aplicaciones " -> " Tu aplicación" -> " Permisos ".

Y compruebe si el permiso del bluetooth se da.

  • Android 4.4.4 Moto G Bluetooth LE vuelve a conectar el problema
  • Getbluetoothservice () llamado sin bluetoothmanagercallback
  • Conectar varios dispositivos a un dispositivo mediante Bluetooth
  • Android Bluetooth Código de baja energía compatible con API> = 21 Y API <21
  • IOS 7 Multipeer Connectivity es compatible con Android Wi-Fi Direct?
  • Con sólo un módulo particular de Bluetooth SPP, .createRfcommSocketToServiceRecord () de repente ya no funciona, pero el método de reflexión funciona
  • Qt Android bluetooth socket escribir problemas en Android 5.1.1 y 6.0
  • ¿Cómo mejorar la medición de la distancia Bluetooth mediante RSSI?
  • Java.io.IOException: lectura fallida, socket podría cerrarse o tiempo de espera, leer ret: -1 en Android 5.0.1 Lollipop version
  • Android Lollipop BLE scan - obtener periféricos sin duplicaciones
  • Emparejamiento Bluetooth sin confirmación del usuario
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.