title: Android Bluetooth LE Scan how to check if device is out of range?
body: <p>I have faced with the issue using <code>startScan</code> method of <code>BluetoothLeScanner</code> a BLE device was found, but when I turned off BLE device my phone still shows this device as turned on !!</p>
  
  <p>I have tried to use:</p>
  
  <pre><code>private ScanCallback mScanCallback = new ScanCallback() {
      @Override
      public void onScanResult(int callbackType, ScanResult result) {
          Log.i("ScanCallback", String.format("onScanResult(int callbackType[%d], ScanResult result)", callbackType));
          final BluetoothDevice btDevice = result.getDevice();
          if (btDevice == null){
              Log.e("ScanCallback", "Could not get bluetooth device");
              return;
          }
  
          final String macAddress = btDevice.getAddress();
          if (callbackType == ScanSettings.CALLBACK_TYPE_MATCH_LOST) {
              // NOTE: I've never got here
              final BluetoothDevice outOfRangeDevice = mBtDevices.get(macAddress);
              ...
          } else {
              ...
          }
      }
      ...
  };
  </code></pre>
  
  <p>Guy, I have not found solution how to detect that BLE device is lost in other resources like (Android SDK reference, forums, stackoverflow and etc) (:</p>
  
  <p>Any help will be appreciated !!</p>