Code example for IntentFilter

Methods: setPriority

0
        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() 
        { 
            context.unregisterReceiver(receiver);
        } 
         
    }