Code example for IntentFilter

Methods: setPriority

0
 
    @Override 
    public void onCreate() 
    { 
    	super.onCreate(); 
	    IntentFilter filter = new IntentFilter(Intent.ACTION_HEADSET_PLUG);
	    filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY - 1);
		headsetPlugReceiver = new BroadcastReceiver() {
		      @Override 
		      public void onReceive(Context context, Intent intent) {
		    	  setBoost(); 
		      } 
	    }; 
	    registerReceiver(headsetPlugReceiver, filter);
    } 
	@Override 
	public void onDestroy() 
	{ 
		try { 
			unregisterReceiver(headsetPlugReceiver);
Stop searching for code, let great code find you!  Add Codota to your java IDE