Comment vérifier si connexion bluetooth à un appareil est déconnecté?

Je veux savoir si ma connexion bluetooth de l'appareil est débranché. J'ai trouvé ceci pour vérifier:

    IntentFilter filter1 = new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED);
    IntentFilter filter2 = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED);
    IntentFilter filter3 = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED);
    this.registerReceiver(mReceiver, filter1);
    this.registerReceiver(mReceiver, filter2);
    this.registerReceiver(mReceiver, filter3);

  //The BroadcastReceiver that listens for bluetooth broadcasts
   mReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

            if (BluetoothDevice.ACTION_FOUND.equals(action)) {
               //Device found
            }
            else if (BluetoothAdapter.ACTION_ACL_CONNECTED.equals(action)) {
               //Device is now connected
            }
            else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
                //Done searching
            }
            else if (BluetoothAdapter.ACTION_ACL_DISCONNECT_REQUESTED.equals(action)) {
               //Device is about to disconnect
            }
            else if (BluetoothAdapter.ACTION_ACL_DISCONNECTED.equals(action)) {
               //Device has disconnected
            }           
        }
    };

Mais la ACTION_ACL_FOUND, ACTION_ACL_DISCONNECT_REQUESTED et la ACTION_ACL_DISCONNECTED dans le onReceive méthode ne peut pas être résolu ou n'est pas un champ.

Alors, pourquoi ils ne peuvent pas être résolus?

Ou est-il une autre solution?

Ne pas vous dire BluetoothDevice.ACTION_ACL_FOUND? Ces champs n'existent pas dans BluetoothAdapter.
J'ai fait référence tho ceci: stackoverflow.com/questions/4715865/...
Changer toutes vos références pour les champs qui ne travaillent pas pour BluetoothDevice. Les champs n'existent pas dans BluetoothAdapter. (developer.android.com/reference/android/bluetooth/...)
Mais le ACTION_DISOVERY_FINISHED fonctionne sur BluetoothAdapter. Donc, je viens de changer les 3 qui ne fonctionne pas?

OriginalL'auteur silvia_aut | 2013-10-25