本文整理匯總了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);
}