title: Bluetooth ACTION_FOUND broadcastReceiver is not working
body: <p>I'm trying to calculate bluetooth RSSI and found some example, but <strong>broadcastReceiver</strong> is not working. The code is this:</p>
  
  <pre><code>private final BroadcastReceiver receiver = new BroadcastReceiver(){
  
      @Override
      public void onReceive(Context context, Intent intent) {
  
          String action = intent.getAction();
          if(BluetoothDevice.ACTION_FOUND.equals(action)) {
              int rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
              String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
              TextView rssi_msg = (TextView) findViewById(R.id.textView1);
              rssi_msg.setText(rssi_msg.getText() + name + " =&gt; " + rssi + "dBm\n");
          }
      }
  };
  </code></pre>
  
  <p>Registered through this:</p>
  
  <pre><code>registerReceiver(receiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));
  </code></pre>
  
  <p>And when button is clicked, BTAdapter.startDiscovery(); is working.
  But nothing changed in textview.</p>
  
  <p>Can you please have some advice for me?</p>
  
  <p>Edit Again:
  I changed my code little more and I'll show my whole code.</p>
  
  <pre><code>public class Blutooth extends Activity {
  
  private BluetoothAdapter BTAdapter = BluetoothAdapter.getDefaultAdapter();
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_blutooth);
  
      Button boton = (Button) findViewById(R.id.button1);
      boton.setOnClickListener(new OnClickListener(){
          public void onClick(View v) {
              BTAdapter.startDiscovery();
          }
      });
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.blutooth, menu);
      return true;
    }
  }
  </code></pre>
  
  <p>And receiver class is</p>
  
  <pre><code>public class TestReceiver extends BroadcastReceiver {
  
  @Override
  public void onReceive(Context context, Intent intent) {
      // TODO Auto-generated method stub
      String name = intent.getAction();
      String device = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
      String rssi_msg = Integer.toString(intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE));
      Toast.makeText(context, name, Toast.LENGTH_SHORT).show();
    }
  
  }
  </code></pre>
  
  <p>I'm trying to Toast <code>intent.getAction();</code> but nothing happened.
  I think <code>BluetoothDevice.ACTION_FOUND</code> is not broadcast.</p>
  
  <p>edit again :
  I'm using android 6.0 version.
  And my whole manifest is this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.blutooth"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-feature android:name="android.hardware.bluetooth" /&gt;
      &lt;uses-permission android:name="android.permission.BLUETOOTH" /&gt;
      &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-sdk
          android:minSdkVersion="23"
          android:targetSdkVersion="23" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".Blutooth"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;receiver android:name=".TestReceiver"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="BluetoothDevice.ACTION_FOUND"&gt;
              &lt;/action&gt;&lt;/intent-filter&gt;
          &lt;/receiver&gt; 
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>I heard over 6.0 version need additional permission to use <code>ACTION_FOUND</code>.
  So, I added <code>ACCESS_FINE_LOCATION</code> and <code>ACCESS_COARSE_LOCATION</code>.
  And I added <code>filter.addAction(BluetoothDevice.ACTION_NAME_CHANGED);</code> code in my activity.
  <code>ACTION_NAME_CHANGED</code> is worked fine and I can get <code>BluetoothDevice.EXTRA_NAME</code>.
  But <code>BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE</code> is not working.
  It print default value -32768.
  Still <code>BluetoothDevice.ACTION_FOUND</code> is not working.</p>