title: Static broadcast not working ANDROID
body: <p>This is my receiver file</p>
  
  <p><code>package com.example.tony.headsetplug;</code></p>
  
  <pre><code>import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.util.Log;
  import android.widget.Toast;
  
  public class MusicIntentReceiver extends BroadcastReceiver {
  
      @Override public void onReceive(Context context, Intent intent) {
          Log.i("Tag","got receiver");
      }
  }
  </code></pre>
  
  <p>I am trying to implement a static broadcast for plugging in the headset, my manifest file where the static broadcast is defined.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
  
      &lt;receiver
          android:name=".MusicIntentReceiver"
          android:enabled="true"
          android:exported="true"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.headset_plug" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;activity
          android:name=".MainActivity"
          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;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>It's not working, not even showing a broadcast received. </p>