Code example for IntentFilter

Methods: setPriority

        private static final IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
        private MediaReceiver receiver;
        private Context context;
        OldApi(Context c)
            filter.setPriority(1); /* 1 higher than the built-in media player */
            receiver = new MediaReceiver();
            context = c;
        public void register() 
            context.registerReceiver(receiver, filter);            
        public void unregister() 
Connect your IDE to all the code out there  Get Codota for Java