当前位置: 首页>>代码示例>>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;未经允许,请勿转载。