title: How to check if bluetooth connection to a device is disconnected?
body: <p>I want to know when my bluetooth connection to the device gets disconnected. I found this to check:</p>
  
  <pre><code>    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
              }           
          }
      };
  </code></pre>
  
  <p>But the <code>ACTION_ACL_FOUND</code>, <code>ACTION_ACL_DISCONNECT_REQUESTED</code> and the <code>ACTION_ACL_DISCONNECTED</code> in the <code>onReceive</code> method can't be resolved or is not a field.</p>
  
  <p>So why they cannot be resolved?</p>
  
  <p>Or is there another new solution for that?</p>