title: Not receiving MEDIA_BUTTON callback
body: <p>I'm trying to create an application that responds when the phone ringer volume is changed via the Volume Key.  I've created a Service that registers a <code>BroadcastReceiver</code>, but the <code>onReceive</code> is not getting called.</p>
  
  <p>I've seen examples in this forum of using <code>audioManager.registerMediaButtonEventReceiver</code> and also using <code>context.registerReceiver</code>.  My class can try either of them depending on the state of <code>useAudioManager</code>.  Either way, the class is being registered, but <code>onReceive</code> never gets called.</p>
  
  <pre><code>    public class VolumeKeyReceiver extends BroadcastReceiver
      {
        private static final boolean useAudioManager = true;
  
        @Override
        public void onReceive( Context context, Intent intent )
        {
          Log.d( "Monitor", "Volume key" );
        }
  
        public void register( Context context )
        {
          if ( useAudioManager )
          {
            AudioManager audioManager = (AudioManager)(context.getSystemService(Context.AUDIO_SERVICE));
            ComponentName componentName = new ComponentName( context, this.getClass() );
            audioManager.registerMediaButtonEventReceiver( componentName );
            Log.d( "Monitor", "registered via AudioManager" );
          }
          else
          {
            IntentFilter filter = new IntentFilter( Intent.ACTION_MEDIA_BUTTON );
            filter.setPriority( IntentFilter.SYSTEM_HIGH_PRIORITY );
            context.registerReceiver( this, filter );
            Log.d( "Monitor", "registered via Context" );
          }
        }
      }
  
  
      public class MonitorService extends Service
      {
        private VolumeKeyReceiver volumeKeyReceiver = null;
        @Override
        public void onCreate()
        {
          super.onCreate();
          volumeKeyReceiver = new VolumeKeyReceiver();
        }
        @Override
        public int onStartCommand(Intent intent, int flags, int startId)
        {
          volumeKeyReceiver.register( this );
          return START_STICKY;
        }
      }
  
      &lt;receiver android:name=".VolumeKeyReceiver"&gt;
          &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.MEDIA_BUTTON" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>I've omitted <code>onDestroy()</code> and <code>unregister()</code> for brevity.</p>
  
  <p>Any idea why I'm not getting the notifications?  Any permissions I'm missing?  I'm testing it on a Galaxy S3.</p>