Broadcast receiver not registering in Android
<p><strong>This is my manifest</strong></p>

<pre><code>&lt;uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="21" /&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=".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;receiver android:name="com.masud.remotecontrol.MyRemoteReceiver" &gt;
        &lt;intent-filter android:priority="1000000000000000" &gt;
            &lt;action android:name="android.intent.action.MEDIA_BUTTON" /&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;
&lt;/application&gt;
</code></pre>

<p></p>

<p><strong>My receiver</strong></p>

<pre><code>static int n_click = 0;

@Override
public void onReceive(final Context context, Intent intent) {

    String intentAction = intent.getAction();

    if (!Intent.ACTION_MEDIA_BUTTON.equals(intentAction)) {
        return;
    }
    KeyEvent event = (KeyEvent) intent
            .getParcelableExtra(Intent.EXTRA_KEY_EVENT);
    if (event == null) {
        return;
    }
    int action = event.getAction();
    switch (event.getKeyCode()) {
    case KeyEvent.KEYCODE_HEADSETHOOK:
        if (action == KeyEvent.ACTION_DOWN) {
            n_click++;
            Handler handler = new Handler();
            Runnable r = new Runnable() {

                @Override
                public void run() {

                    if (n_click == 1) {

                        Log.e("Click==", "Single Click");

                    }

                    if (n_click == 2) {

                        Log.e("Click==", "Double Click");

                    }
                    n_click = 0;
                }
            };
            if (n_click == 1) {

                handler.postDelayed(r, 500);
            }
        }
        break;
    }
    abortBroadcast();
}
</code></pre>

<p>I have tried my level best to register my receiver but I have not get any solution in to register. I have tried all the solution found in stackoverflow but no one is working.</p>