當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.ACTION_CLOSE_SYSTEM_DIALOGS屬性代碼示例

本文整理匯總了Java中android.content.Intent.ACTION_CLOSE_SYSTEM_DIALOGS屬性的典型用法代碼示例。如果您正苦於以下問題:Java Intent.ACTION_CLOSE_SYSTEM_DIALOGS屬性的具體用法?Java Intent.ACTION_CLOSE_SYSTEM_DIALOGS怎麽用?Java Intent.ACTION_CLOSE_SYSTEM_DIALOGS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.ACTION_CLOSE_SYSTEM_DIALOGS屬性的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onReceive

@Override
public void onReceive(Context context, Intent intent) {
    int reminderId = intent.getIntExtra("NOTIFICATION_ID", 0);

    if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("checkBoxNagging", false)) {
        Intent alarmIntent = new Intent(context, NagReceiver.class);
        AlarmUtil.cancelAlarm(context, alarmIntent, reminderId);
    }

    // Close notification tray
    Intent closeIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    context.sendBroadcast(closeIntent);

    Intent snoozeIntent = new Intent(context, SnoozeDialogActivity.class);
    snoozeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    snoozeIntent.putExtra("NOTIFICATION_ID", reminderId);
    context.startActivity(snoozeIntent);
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:18,代碼來源:SnoozeActionReceiver.java

示例2: init

private void init() {
    L.i("init service");

    //動態注冊
    smsReceiver = new SmsReceiver();
    IntentFilter intent = new IntentFilter();
    //添加Action
    intent.addAction(StaticClass.SMS_ACTION);
    //設置權限
    intent.setPriority(Integer.MAX_VALUE);
    //注冊
    registerReceiver(smsReceiver, intent);

    mHomeWatchReceiver = new HomeWatchReceiver();
    IntentFilter intentFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    registerReceiver(mHomeWatchReceiver, intentFilter);
}
 
開發者ID:lijizhi,項目名稱:studydemo,代碼行數:17,代碼來源:SmsService.java

示例3: init

private void init() {
    LogUtil.i("init service");
    /*
    * 動態注冊廣播
    * */
    mSmsReceiver = new SmsReceiver();
    IntentFilter intentFilter = new IntentFilter();
    //添加Action
    intentFilter.addAction(StaticClass.SMS_ACTION);
    //設置優先級,穀歌優先級最大值為1000,這裏我設置為int的最大值
    intentFilter.setPriority(Integer.MAX_VALUE);
    //注冊
    registerReceiver(mSmsReceiver, intentFilter);

    mHomeWatchReceiver = new HomeWatchReceiver();
    IntentFilter intentFilter1 = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    registerReceiver(mHomeWatchReceiver, intentFilter1);
}
 
開發者ID:Hultron,項目名稱:LifeHelper,代碼行數:18,代碼來源:SmsService.java

示例4: onClick

@Override
    public void onClick() {
        super.onClick();
        if (DEBUG) {
            MyLog.i(CLS_NAME, "onClick");
        }

        final LocalRequest lr = new LocalRequest(getApplicationContext());
        lr.prepareIntro();
        lr.execute();

        final Intent closeShadeIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        sendBroadcast(closeShadeIntent);

//        final Intent preferenceIntent = new Intent(getApplicationContext(), ActivityTilePreferences.class);
//        startActivityAndCollapse(preferenceIntent);
    }
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:17,代碼來源:SaiyTileService.java

示例5: onClick

@Override
public void onClick() {
    Intent intentBatteryUsage = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
    startActivity(intentBatteryUsage);

    Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    sendBroadcast(it);
}
 
開發者ID:zacharee,項目名稱:SystemUITuner2,代碼行數:8,代碼來源:BatteryTileService.java

示例6: invoke

/**
 * HOME 鍵廣播接收器
 *
 * @param context 上下文對象
 * @param listener 監聽器
 */
public static void invoke(Context context, OnHomePressedListener listener) {
    if (instance == null) {
        instance = new HomeReceiver();
        IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        context.registerReceiver(instance, filter);
    }
    instance.listener = listener;
}
 
開發者ID:wl9739,項目名稱:CustomLockScreen,代碼行數:14,代碼來源:HomeReceiver.java

示例7: onCreate

@Override
public void onCreate() {
    super.onCreate();
    appContext = getApplicationContext();
    boolean canDraw = true;
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        // If the version requires a permission to draw over apps,
        canDraw = Settings.canDrawOverlays(appContext);
    }
    if (canDraw) {
        // If Forge is allowed to draw over other apps
        // Close the notifications status bar
        Intent closeStatusBarIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        appContext.sendBroadcast(closeStatusBarIntent);
        // Load the current account
        account = CurrentManager.loadCurrentAccount(appContext);
        // Get the window manager
        windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
        // Get the layout inflater
        LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
        // Create the view from the forge overlay layout
        view = layoutInflater.inflate(R.layout.forge_overlay, null);

        setUpEditTexts();
        setUpButtons();

        // Set up window manager parameters
        WindowManager.LayoutParams params;

        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            // If the device is version Oreo or greater
            params = new WindowManager.LayoutParams(
                    WindowManager.LayoutParams.MATCH_PARENT,
                    WindowManager.LayoutParams.MATCH_PARENT,
                    WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
                    WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
                    PixelFormat.TRANSPARENT);
        } else {
            // If the device is pre-Oreo
            params = new WindowManager.LayoutParams(
                    WindowManager.LayoutParams.MATCH_PARENT,
                    WindowManager.LayoutParams.MATCH_PARENT,
                    WindowManager.LayoutParams.TYPE_PHONE,
                    WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
                    PixelFormat.TRANSPARENT);
        }
        params.gravity = Gravity.CENTER;

        // Display the view over the app
        windowManager.addView(view, params);
    } else {
        this.stopSelf();
    }
}
 
開發者ID:jthomperoo,項目名稱:Forge,代碼行數:54,代碼來源:OverlayService.java

示例8: HomeWatcher

public HomeWatcher(Context context) {
    mContext = context;
    //當按下Home鍵時,係統會發出action為Intent.ACTION_CLOSE_SYSTEM_DIALOGS的BroadcastReceiver
    mFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
}
 
開發者ID:androidmalin,項目名稱:StartThirdApp,代碼行數:5,代碼來源:HomeWatcher.java

示例9: closeStatusBar

private void closeStatusBar(Context context) {

        Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        context.sendBroadcast(it);
    }
 
開發者ID:tranleduy2000,項目名稱:text_converter,代碼行數:5,代碼來源:EncodeReceiver.java

示例10: closeStatusBar

private void closeStatusBar(Context context) {
    Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    context.sendBroadcast(it);
}
 
開發者ID:tranleduy2000,項目名稱:text_converter,代碼行數:4,代碼來源:DecodeReceiver.java

示例11: collapseStatusBar

public static void collapseStatusBar(Context context) {
    Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    context.sendBroadcast(it);
}
 
開發者ID:gojuukaze,項目名稱:ScreenOffTime,代碼行數:4,代碼來源:ScreenService.java

示例12: HomeButtonPressWatcher

public HomeButtonPressWatcher(Context context) {
    mContext = context;
    mFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
}
 
開發者ID:OhMyLob,項目名稱:Paper-Launcher,代碼行數:4,代碼來源:HomeButtonPressWatcher.java

示例13: registerHomeKeyReceiver

private void registerHomeKeyReceiver(Context context) {
    log.i("registerHomeKeyReceiver", "registerHomeKeyReceiver");
    mHomeKeyReceiver = new HomeWatcherReceiver();
    final IntentFilter homeFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
    context.registerReceiver(mHomeKeyReceiver, homeFilter);
}
 
開發者ID:lisnstatic,項目名稱:live_master,代碼行數:6,代碼來源:WatchLiveActivity.java


注:本文中的android.content.Intent.ACTION_CLOSE_SYSTEM_DIALOGS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。