List of usage examples for android.content Intent ACTION_CLOSE_SYSTEM_DIALOGS
String ACTION_CLOSE_SYSTEM_DIALOGS
To view the source code for android.content Intent ACTION_CLOSE_SYSTEM_DIALOGS.
Click Source Link
From source file:com.klinker.android.launcher.launcher3.Launcher.java
@Override protected void onCreate(Bundle savedInstanceState) { if (DEBUG_STRICT_MODE) { StrictMode.setThreadPolicy(//from www . j a va 2s. c om new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork() // or .detectAll() for all detectable problems .penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects() .detectLeakedClosableObjects().penaltyLog().penaltyDeath().build()); } predictiveAppsProvider = new PredictiveAppsProvider(this); if (mLauncherCallbacks != null) { mLauncherCallbacks.preOnCreate(); } try { super.onCreate(savedInstanceState); } catch (Exception e) { super.onCreate(new Bundle()); } LauncherAppState.setApplicationContext(getApplicationContext()); LauncherAppState app = LauncherAppState.getInstance(); // Load configuration-specific DeviceProfile mDeviceProfile = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? app.getInvariantDeviceProfile().landscapeProfile : app.getInvariantDeviceProfile().portraitProfile; mSharedPrefs = getSharedPreferences(LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE); mIsSafeModeEnabled = getPackageManager().isSafeMode(); mModel = app.setLauncher(this); mIconCache = app.getIconCache(); mDragController = new DragController(this); mInflater = getLayoutInflater(); mStateTransitionAnimation = new LauncherStateTransitionAnimation(this, this); mStats = new Stats(this); mAppWidgetManager = AppWidgetManagerCompat.getInstance(this); mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID); mAppWidgetHost.startListening(); // If we are getting an onCreate, we can actually preempt onResume and unset mPaused here, // this also ensures that any synchronous binding below doesn't re-trigger another // LauncherModel load. mPaused = false; if (PROFILE_STARTUP) { android.os.Debug.startMethodTracing(Environment.getExternalStorageDirectory() + "/launcher"); } setContentView(R.layout.launcher); setupViews(); setUpBlur(); mDeviceProfile.layout(this); lockAllApps(); mSavedState = savedInstanceState; restoreState(mSavedState); if (PROFILE_STARTUP) { android.os.Debug.stopMethodTracing(); } if (!mRestoring) { if (DISABLE_SYNCHRONOUS_BINDING_CURRENT_PAGE) { // If the user leaves launcher, then we should just load items asynchronously when // they return. mModel.startLoader(PagedView.INVALID_RESTORE_PAGE); } else { // We only load the page synchronously if the user rotates (or triggers a // configuration change) while launcher is in the foreground mModel.startLoader(mWorkspace.getRestorePage()); } } // For handling default keys mDefaultKeySsb = new SpannableStringBuilder(); Selection.setSelection(mDefaultKeySsb, 0); IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); registerReceiver(mCloseSystemDialogsReceiver, filter); mRotationEnabled = Utilities.isRotationAllowedForDevice(getApplicationContext()); // In case we are on a device with locked rotation, we should look at preferences to check // if the user has specifically allowed rotation. if (!mRotationEnabled) { mRotationEnabled = Utilities.isAllowRotationPrefEnabled(getApplicationContext(), false); } // On large interfaces, or on devices that a user has specifically enabled screen rotation, // we want the screen to auto-rotate based on the current orientation setOrientation(); if (mLauncherCallbacks != null) { mLauncherCallbacks.onCreate(savedInstanceState); if (mLauncherCallbacks.hasLauncherOverlay()) { ViewStub stub = (ViewStub) findViewById(R.id.launcher_overlay_stub); mLauncherOverlayContainer = (InsettableFrameLayout) stub.inflate(); mLauncherOverlay = mLauncherCallbacks.setLauncherOverlayView(mLauncherOverlayContainer, mLauncherOverlayCallbacks); mWorkspace.setLauncherOverlay(mLauncherOverlay); } } if (shouldShowIntroScreen()) { showIntroScreen(); } else { showFirstRunActivity(); showFirstRunClings(); } }
From source file:g7.bluesky.launcher3.Launcher.java
@Override protected void onCreate(Bundle savedInstanceState) { activity = this; if (DEBUG_STRICT_MODE) { StrictMode.setThreadPolicy(//from www.j a v a 2s . c om new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork() // or .detectAll() for all detectable problems .penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects() .detectLeakedClosableObjects().penaltyLog().penaltyDeath().build()); } if (mLauncherCallbacks != null) { mLauncherCallbacks.preOnCreate(); } super.onCreate(savedInstanceState); LauncherAppState.setApplicationContext(getApplicationContext()); LauncherAppState app = LauncherAppState.getInstance(); LauncherAppState.getLauncherProvider().setLauncherProviderChangeListener(this); // Lazy-initialize the dynamic grid DeviceProfile grid = app.initDynamicGrid(this); // the LauncherApplication should call this, but in case of Instrumentation it might not be present yet mSharedPrefs = getSharedPreferences(LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE); // Set defaultSharedPref defaultSharedPref = PreferenceManager.getDefaultSharedPreferences(this); mIsSafeModeEnabled = getPackageManager().isSafeMode(); mModel = app.setLauncher(this); mIconCache = app.getIconCache(); mIconCache.flushInvalidIcons(grid); mDragController = new DragController(this); mInflater = getLayoutInflater(); mStats = new Stats(this); mAppWidgetManager = AppWidgetManagerCompat.getInstance(this); mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID); mAppWidgetHost.startListening(); // If we are getting an onCreate, we can actually preempt onResume and unset mPaused here, // this also ensures that any synchronous binding below doesn't re-trigger another // LauncherModel load. mPaused = false; if (PROFILE_STARTUP) { android.os.Debug.startMethodTracing(Environment.getExternalStorageDirectory() + "/launcher"); } checkForLocaleChange(); setContentView(R.layout.launcher); setupViews(); grid.layout(this); registerContentObservers(); lockAllApps(); mSavedState = savedInstanceState; restoreState(mSavedState); if (PROFILE_STARTUP) { android.os.Debug.stopMethodTracing(); } if (!mRestoring) { if (DISABLE_SYNCHRONOUS_BINDING_CURRENT_PAGE) { // If the user leaves launcher, then we should just load items asynchronously when // they return. mModel.startLoader(true, PagedView.INVALID_RESTORE_PAGE); } else { // We only load the page synchronously if the user rotates (or triggers a // configuration change) while launcher is in the foreground mModel.startLoader(true, mWorkspace.getRestorePage()); } } // For handling default keys mDefaultKeySsb = new SpannableStringBuilder(); Selection.setSelection(mDefaultKeySsb, 0); IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); registerReceiver(mCloseSystemDialogsReceiver, filter); // On large interfaces, we want the screen to auto-rotate based on the current orientation unlockScreenOrientation(true); if (mLauncherCallbacks != null) { mLauncherCallbacks.onCreate(savedInstanceState); if (mLauncherCallbacks.hasLauncherOverlay()) { ViewStub stub = (ViewStub) findViewById(R.id.launcher_overlay_stub); mLauncherOverlayContainer = (InsettableFrameLayout) stub.inflate(); mLauncherOverlay = mLauncherCallbacks.setLauncherOverlayView(mLauncherOverlayContainer, mLauncherOverlayCallbacks); mWorkspace.setLauncherOverlay(mLauncherOverlay); } } if (shouldShowIntroScreen()) { showIntroScreen(); } else { showFirstRunActivity(); showFirstRunClings(); } //create extramenu //llExtraMenu = (LinearLayout) findViewById(R.id.ll_extra_menu); //llExtraMenu.addView(new ExtraMenu(this, null)); flLauncher = (LauncherRootView) findViewById(R.id.launcher); mExtraMenu = new ExtraMenu(this, null); flLauncher.addView(mExtraMenu); if (!defaultSharedPref.getBoolean(SettingConstants.EXTRA_MENU_PREF_KEY, false)) { mExtraMenu.setVisibility(View.GONE); } editTextFilterApps.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) { } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { } @Override public void afterTextChanged(Editable arg0) { String searchString = editTextFilterApps.getText().toString(); if (listApps != null && listApps.size() > 0) { if (searchString.trim().length() > 0) { ArrayList<AppInfo> searchList = new ArrayList<>(); for (AppInfo appInfo : listApps) { String appTitle = StringUtil .convertVNString(appInfo.getTitle().toString().toLowerCase().trim()); searchString = StringUtil.convertVNString(searchString.toLowerCase().trim()); if (appTitle.contains(searchString)) { searchList.add(appInfo); } } mAppsCustomizeContent.setApps(searchList); } else { mAppsCustomizeContent.setApps((ArrayList<AppInfo>) listApps); } } } }); // Spinner element Spinner spinner = (Spinner) findViewById(R.id.spinner); // Spinner click listener spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { // Clear spinner text ((TextView) view).setText(null); SharedPreferences.Editor editor = defaultSharedPref.edit(); editor.putInt(SettingConstants.SORT_PREF_KEY, position); editor.apply(); // Value from preference int prefVal = defaultSharedPref.getInt(SettingConstants.SORT_PREF_KEY, SettingConstants.SORT_A_Z); LauncherUtil.sortListApps(defaultSharedPref, listApps, prefVal); mAppsCustomizeContent.invalidatePageData(); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); // Creating adapter for spinner ArrayAdapter<CharSequence> dataAdapter = ArrayAdapter.createFromResource(this, R.array.sort_options, android.R.layout.simple_spinner_item); // Drop down layout style - list view with radio button dataAdapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice); // attaching data adapter to spinner spinner.setAdapter(dataAdapter); // Set default value final int prefSortOptionVal = defaultSharedPref.getInt(SettingConstants.SORT_PREF_KEY, SettingConstants.SORT_A_Z); spinner.setSelection(prefSortOptionVal); // Listen on pref change prefChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() { @Override public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { if (key.equalsIgnoreCase(SettingConstants.EXTRA_MENU_PREF_KEY)) { if (!defaultSharedPref.getBoolean(SettingConstants.EXTRA_MENU_PREF_KEY, false)) { mExtraMenu.setVisibility(View.GONE); } else { mExtraMenu.setVisibility(View.VISIBLE); } } else if (key.equalsIgnoreCase(SettingConstants.ICON_THEME_PREF_KEY)) { mModel.forceReload(); loadIconPack(); } } }; defaultSharedPref.registerOnSharedPreferenceChangeListener(prefChangeListener); }
From source file:com.android.soma.Launcher.java
@Override protected void onCreate(Bundle savedInstanceState) { if (DEBUG_STRICT_MODE) { StrictMode.setThreadPolicy(//from w w w . j a va2s. c om new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork() // or .detectAll() for all detectable problems .penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects() .detectLeakedClosableObjects().penaltyLog().penaltyDeath().build()); } super.onCreate(savedInstanceState); LauncherAppState.setApplicationContext(getApplicationContext()); LauncherAppState app = LauncherAppState.getInstance(); // Determine the dynamic grid properties Point smallestSize = new Point(); Point largestSize = new Point(); Point realSize = new Point(); Display display = getWindowManager().getDefaultDisplay(); display.getCurrentSizeRange(smallestSize, largestSize); display.getRealSize(realSize); DisplayMetrics dm = new DisplayMetrics(); display.getMetrics(dm); // Lazy-initialize the dynamic grid DeviceProfile grid = app.initDynamicGrid(this, Math.min(smallestSize.x, smallestSize.y), Math.min(largestSize.x, largestSize.y), realSize.x, realSize.y, dm.widthPixels, dm.heightPixels); // the LauncherApplication should call this, but in case of Instrumentation it might not be present yet mSharedPrefs = getSharedPreferences(LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE); mModel = app.setLauncher(this); mIconCache = app.getIconCache(); mIconCache.flushInvalidIcons(grid); mDragController = new DragController(this); mInflater = getLayoutInflater(); mStats = new Stats(this); mAppWidgetManager = AppWidgetManager.getInstance(this); mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID); mAppWidgetHost.startListening(); // If we are getting an onCreate, we can actually preempt onResume and unset mPaused here, // this also ensures that any synchronous binding below doesn't re-trigger another // LauncherModel load. mPaused = false; if (PROFILE_STARTUP) { android.os.Debug.startMethodTracing(Environment.getExternalStorageDirectory() + "/launcher"); } checkForLocaleChange(); setContentView(R.layout.launcher); setupViews(); grid.layout(this); registerContentObservers(); lockAllApps(); mSavedState = savedInstanceState; restoreState(mSavedState); // Update customization drawer _after_ restoring the states if (mAppsCustomizeContent != null) { mAppsCustomizeContent.onPackagesUpdated(LauncherModel.getSortedWidgetsAndShortcuts(this)); } { { final RajawaliSurfaceView surface = new RajawaliSurfaceView(this); surface.setFrameRate(60.0); surface.setRenderMode(IRajawaliSurface.RENDERMODE_WHEN_DIRTY); // Add mSurface to your root view addContentView(surface, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT)); mRenderer = new WallpaperRenderer(this); surface.setSurfaceRenderer(mRenderer); } } if (PROFILE_STARTUP) { android.os.Debug.stopMethodTracing(); } if (!mRestoring) { if (sPausedFromUserAction) { // If the user leaves launcher, then we should just load items asynchronously when // they return. mModel.startLoader(true, -1); } else { // We only load the page synchronously if the user rotates (or triggers a // configuration change) while launcher is in the foreground mModel.startLoader(true, mWorkspace.getCurrentPage()); } } // For handling default keys mDefaultKeySsb = new SpannableStringBuilder(); Selection.setSelection(mDefaultKeySsb, 0); IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); registerReceiver(mCloseSystemDialogsReceiver, filter); updateGlobalIcons(); // On large interfaces, we want the screen to auto-rotate based on the current orientation unlockScreenOrientation(true); showFirstRunCling(); // following code is for Native method support test { } }
From source file:com.allwinner.theatreplayer.launcher.activity.LaunchActivity.java
private void registerHomeKeyEventReceiver() { IntentFilter HomeKeyfilter = new IntentFilter(); HomeKeyfilter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); registerReceiver(mHomeKeyEventReceiver, HomeKeyfilter); }
From source file:xj.property.activity.HXBaseActivity.MainActivity.java
private void registerHomeKeyReceiver(Context context) { Log.i(TAG, "registerHomeKeyReceiver"); mHomeKeyReceiver = new HomeWatcherReceiver(); final IntentFilter homeFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); context.registerReceiver(mHomeKeyReceiver, homeFilter); }
From source file:cw.kop.autobackground.LiveWallpaperService.java
private void closeNotificationDrawer(Context context) { Intent closeDrawer = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); context.sendBroadcast(closeDrawer); }
From source file:com.cognizant.trumobi.PersonaLauncher.java
private void registerIntentReceivers() { boolean useNotifReceiver = PersonaAlmostNexusSettingsHelper.getNotifReceiver(this); if (useNotifReceiver && mCounterReceiver == null) { mCounterReceiver = new PersonaCounterReceiver(this); mCounterReceiver.setCounterListener(new PersonaCounterReceiver.OnCounterChangedListener() { public void onTrigger(String pname, int counter, int color) { PersonaLog.d("personalauncher", "updateCountersForPackage called from registerIntentReceivers"); //updateCountersForPackage(pname, counter, color, 0); Bundle b = new Bundle(); b.putString("package", "com.cognizant.trumobi"); b.putInt("counter", counter); b.putInt("color", R.color.PR_TEXTBOX_FOCUSED_COLOR); b.putInt("updateCountFor", 0); Message m = new Message(); m.setData(b);/*from w w w .ja v a2 s .c om*/ UiHandler.sendMessage(m); } }); registerReceiver(mCounterReceiver, mCounterReceiver.getFilter()); } IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED); filter.addAction(Intent.ACTION_PACKAGE_REMOVED); filter.addAction(Intent.ACTION_PACKAGE_CHANGED); filter.addDataScheme("package"); registerReceiver(mApplicationsReceiver, filter); filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); registerReceiver(mCloseSystemDialogsReceiver, filter); filter = new IntentFilter(); filter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE); filter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE); registerReceiver(mApplicationsReceiver, filter); }