title: Discovering bluetooth devices on Android (example) isnt working
body: <pre><code>   final BroadcastReceiver bReceiver = new BroadcastReceiver() {
          public void onReceive(Context context, Intent intent) {
              String action = intent.getAction();
              if (BluetoothDevice.ACTION_FOUND.equals(action)) {
                   BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
                   BTArrayAdapter.add(device.getName() + "\n" + device.getAddress());
                   BTArrayAdapter.notifyDataSetChanged();
              }
          }
      };
  
     public void find(View view) {
         if (myBluetoothAdapter.isDiscovering()) {
             myBluetoothAdapter.cancelDiscovery();
         }
         else {
              BTArrayAdapter.clear();
              myBluetoothAdapter.startDiscovery();
  
              registerReceiver(bReceiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));    
          }    
     }
  </code></pre>
  
  <p>When pressing "findBtn" there is no any devices. The simple code at developer.android.com. How to discover correctly? Any mistakes in the code?
  Example <a href="https://examples.javacodegeeks.com/android/core/bluetooth/bluetoothadapter/android-bluetooth-example/" rel="nofollow noreferrer">here</a>.</p>