ACTION_DISCOVERY_STARTED nunca se llama android

Tengo el siguiente código:

public class AddPrinter extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); bluetoothAdapter.startDiscovery(); filter = new IntentFilter(); filter.addAction(BluetoothDevice.ACTION_FOUND); filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED); filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); registerReceiver(receiver, filter); } BroadcastReceiver receiver = new BroadcastReceiver() { @Override 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); adapter.add(device); } else if (BluetoothAdapter.ACTION_DISCOVERY_STARTED.equals(intent.getAction())) { System.out.println("STARTED"); } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(intent.getAction())) { Utils.dialog.dismiss(); } } }; 

El problema que tengo es tan extraño, por alguna razón el ACTION_DISCOVERY_STARTED nunca se llama, pero todas las otras acciones están bien, ¿qué me falta? Gracias por tu tiempo.

prueba esto

 public class AddPrinter extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); filter = new IntentFilter(BluetoothDevice.ACTION_FOUND); registerReceiver(receiver, filter); filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_STARTED); registerReceiver(receiver, filter); filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); registerReceiver(receiver, filter); // bluetoothAdapter.startDiscovery(); } 

poner bluetoothAdapter.startDiscovery(); después de registrar recevier

  • Diferencia entre CONNECTION_STATE_CHANGED y STATE_CHANGED
  • Múltiples conexiones bluetooth
  • Envío de archivos Bluetooth de Android
  • ¿Cómo obtener un registro de exploración sin procesar (paquetes publicitarios) al escanear dispositivos bluetooth clásicos en Android?
  • Cómo ejecutar wifi peer to peer aplicación en el emulador de Android ..?
  • Transferir datos entre iOS y Android a través de Bluetooth?
  • Conexión Bluetooth sin emparejamiento
  • Ejemplo de Android Bluetooth
  • Cifrado de baja energía de Bluetooth y seguridad de datos
  • ¿Es posible conectar iOS y dispositivos Android con Bluetooth?
  • Android BluetoothSocket.isConnected siempre devuelve false
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.