title: Bluetooth Classic scan not showing devices
body: <p>Im implementing a simple blutooth classic scan from the <a href="https://developer.android.com/guide/topics/connectivity/bluetooth" rel="nofollow noreferrer">official docs</a> on my Redmi Note 4 (Bluetooth 4.1).</p>
  
  <p>However I am not seeing a toast that should appear when the onReceive function on the broadcast receiver is called. </p>
  
  <p>What could be wrong here? </p>
  
  <pre><code>
  class MainActivity : AppCompatActivity() {
  
   override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          defaultAdapter = BluetoothAdapter.getDefaultAdapter()
          if (defaultAdapter == null) {
              toast("no adapter")
              return
          }
          if (!defaultAdapter!!.isEnabled) {
              val enableBluetoothIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)
              startActivityForResult(enableBluetoothIntent, REQUEST_ENABLE_BLUETOOTH)
          }
          searchButton.setOnClickListener { newDevicesList() }
  
          val filter = IntentFilter(BluetoothDevice.ACTION_FOUND)
          Log.i("receiver", "registering receiver")
          registerReceiver(receiver, filter)
  
      }
  
  private val receiver = object : BroadcastReceiver() {
  
          override fun onReceive(context: Context, intent: Intent) {
              toast("maybe i find new device who know")
              when (intent.action) {
                  BluetoothDevice.ACTION_FOUND -&gt; {
                      // Discovery has found a device. Get the BluetoothDevice
                      // object and its info from the Intent.
                      val device: BluetoothDevice? =
                              intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE)
                      val deviceName = device?.name
                      val deviceHardwareAddress = device?.address // MAC address
                      toast("device $deviceName was found")
                  }
                  BluetoothAdapter.ACTION_DISCOVERY_FINISHED -&gt; {
                      context.unregisterReceiver(this)
                  }
              }
  
          if (defaultAdapter!!.isDiscovering) {
              toast("scan already in progress")
          } else {
              toast("starting discovery")
              defaultAdapter!!.startDiscovery();
          }
      }
  
  </code></pre>
  
  <p>How do i know that the onReceive function never gets called? cause this toast <em>toast("maybe i find new device who know")</em> never appears.</p>