本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
}
示例8: HomeWatcher
public HomeWatcher(Context context) {
mContext = context;
//当按下Home键时,系统会发出action为Intent.ACTION_CLOSE_SYSTEM_DIALOGS的BroadcastReceiver
mFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
}
示例9: closeStatusBar
private void closeStatusBar(Context context) {
Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
context.sendBroadcast(it);
}
示例10: closeStatusBar
private void closeStatusBar(Context context) {
Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
context.sendBroadcast(it);
}
示例11: collapseStatusBar
public static void collapseStatusBar(Context context) {
Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
context.sendBroadcast(it);
}
示例12: HomeButtonPressWatcher
public HomeButtonPressWatcher(Context context) {
mContext = context;
mFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
}
示例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);
}