Code example for IntentFilter

Methods: addAction

0
        if (mIntentReceiver == null) {
            mIntentReceiver = new TimeChangedReceiver(this);
            IntentFilter filter = new IntentFilter();
            filter.addAction(Intent.ACTION_TIME_TICK);
            filter.addAction(Intent.ACTION_TIME_CHANGED);
            filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
            mContext.registerReceiver(mIntentReceiver, filter);
        } 
 
        /* monitor 12/24-hour display preference */ 
        if (mFormatChangeObserver == null) {
            mFormatChangeObserver = new FormatChangeObserver(this);
            mContext.getContentResolver().registerContentObserver( 
                    Settings.System.CONTENT_URI, true, mFormatChangeObserver);
        } 
 
        updateTime(); 
    } 
 
    @Override 
    protected void onDetachedFromWindow() {