List of usage examples for android.os Bundle getBoolean
public boolean getBoolean(String key)
From source file:me.piebridge.prevent.framework.SystemReceiver.java
private void handleConfiguration(Bundle bundle) { setForceStopTimeout(bundle.getLong(PreventIntent.KEY_FORCE_STOP_TIMEOUT)); SystemHook.setDestroyProcesses(bundle.getBoolean(PreventIntent.KEY_DESTROY_PROCESSES)); SystemHook.setLockSyncSettings(bundle.getBoolean(PreventIntent.KEY_LOCK_SYNC_SETTINGS)); SystemHook.setUseAppStandby(bundle.getBoolean(PreventIntent.KEY_USE_APP_STANDBY)); setAutoPrevent(bundle.getBoolean(PreventIntent.KEY_AUTO_PREVENT, true)); if (bundle.containsKey(PreventIntent.KEY_STOP_SIGNATURE_APPS)) { // this is not an option can set from ui SystemHook.setStopSignatureApps(bundle.getBoolean(PreventIntent.KEY_STOP_SIGNATURE_APPS, true)); }/*from w ww . jav a2 s. c om*/ if (bundle.containsKey(PreventIntent.KEY_PREVENT_LIST)) { updatePreventList(bundle.getStringArrayList(PreventIntent.KEY_PREVENT_LIST)); } saveConfiguration(new Configuration(bundle), true); }
From source file:ca.marklauman.tools.FragmentPopup.java
@Override public void onViewCreated(View v, Bundle savedInstanceState) { super.onViewCreated(v, savedInstanceState); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) setupAnimator();/*from w ww.j a v a 2s.co m*/ if (savedInstanceState != null) { message = savedInstanceState.getCharSequence(KEY_MSG); button_vis = savedInstanceState.getBoolean(KEY_BTN); } if (message != null) show(message, button_vis, true); }
From source file:arefin.dialogs.core.BaseDialogFragment.java
/** * Resolves the theme to be used for the dialog. * * @return The theme./*from w ww .ja va 2s . c om*/ */ @StyleRes private int resolveTheme() { // First check if getTheme() returns some usable theme. int theme = getTheme(); if (theme != 0) { return theme; } // Get the light/dark attribute from the Activity's Theme. boolean useLightTheme = isActivityThemeLight(); // Now check if developer overrides the Activity's Theme with an argument. Bundle args = getArguments(); if (args != null) { if (args.getBoolean(BaseDialogBuilder.ARG_USE_DARK_THEME)) { // Developer is explicitly using the dark theme. useLightTheme = false; } else if (args.getBoolean(BaseDialogBuilder.ARG_USE_LIGHT_THEME)) { // Developer is explicitly using the light theme. useLightTheme = true; } } return useLightTheme ? R.style.SDL_Dialog : R.style.SDL_Dark_Dialog; }
From source file:android.support.car.ui.CarNavExtender.java
/** * Reconstruct a CarNavExtender from an existing notification. Can be used to retrieve values. * * @param notification The notification to retrieve the values from. *//* w ww . j a v a 2 s.c o m*/ public CarNavExtender(@NonNull Notification notification) { Bundle extras = NotificationCompat.getExtras(notification); if (extras == null) { return; } Bundle b = extras.getBundle(EXTRA_CAR_EXTENDER); if (b == null) { return; } mIsExtended = b.getBoolean(EXTRA_IS_EXTENDED); mContentId = (Long) b.getSerializable(EXTRA_CONTENT_ID); // The ternary guarantees that we return either TYPE_HERO or TYPE_NORMAL. mType = (b.getInt(EXTRA_TYPE, TYPE_NORMAL) == TYPE_HERO) ? TYPE_HERO : TYPE_NORMAL; mContentTitle = b.getCharSequence(Notification.EXTRA_TITLE); mContentText = b.getCharSequence(Notification.EXTRA_TEXT); mSubText = b.getCharSequence(EXTRA_SUB_TEXT); mLargeIcon = b.getParcelable(Notification.EXTRA_LARGE_ICON); mActionIcon = b.getInt(EXTRA_ACTION_ICON); mContentIntent = b.getParcelable(EXTRA_CONTENT_INTENT); mColor = b.getInt(EXTRA_COLOR, Notification.COLOR_DEFAULT); mNightColor = b.getInt(EXTRA_NIGHT_COLOR, Notification.COLOR_DEFAULT); mShowInStream = b.getBoolean(EXTRA_STREAM_VISIBILITY, true); mShowAsHeadsUp = b.getBoolean(EXTRA_HEADS_UP_VISIBILITY); mIgnoreInStream = b.getBoolean(EXTRA_IGNORE_IN_STREAM); }
From source file:com.android.contacts.preference.DisplayOptionsPreferenceFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load the preferences from an XML resource addPreferencesFromResource(R.xml.preference_display_options); final Bundle args = getArguments(); mNewLocalProfileExtra = args.getString(ARG_NEW_LOCAL_PROFILE); mAreContactsAvailable = args.getBoolean(ARG_CONTACTS_AVAILABLE); removeUnsupportedPreferences();/* ww w . j ava2 s . c o m*/ mMyInfoPreference = findPreference(KEY_MY_INFO); final Preference accountsPreference = findPreference(KEY_ACCOUNTS); accountsPreference.setOnPreferenceClickListener(this); final Preference importPreference = findPreference(KEY_IMPORT); importPreference.setOnPreferenceClickListener(this); final Preference exportPreference = findPreference(KEY_EXPORT); if (exportPreference != null) { exportPreference.setOnPreferenceClickListener(this); } final Preference blockedNumbersPreference = findPreference(KEY_BLOCKED_NUMBERS); if (blockedNumbersPreference != null) { blockedNumbersPreference.setOnPreferenceClickListener(this); } final Preference aboutPreference = findPreference(KEY_ABOUT); if (aboutPreference != null) { aboutPreference.setOnPreferenceClickListener(this); } final Preference customFilterPreference = findPreference(KEY_CUSTOM_CONTACTS_FILTER); if (customFilterPreference != null) { customFilterPreference.setOnPreferenceClickListener(this); setCustomContactsFilterSummary(); } }
From source file:cn.scujcc.bug.bitcoinplatformandroid.fragment.CandlestickChartsFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); savedInstanceState = getArguments(); if (savedInstanceState != null) { isFull = savedInstanceState.getBoolean(ARGS_IS_FULL); }/*from w ww . j a va 2s . co m*/ }
From source file:arefin.dialogs.core.BaseDialogFragment.java
@NonNull @Override// w ww . j a va2 s. c o m public Dialog onCreateDialog(Bundle savedInstanceState) { int theme = resolveTheme(); Dialog dialog = new Dialog(getActivity(), theme); Bundle args = getArguments(); if (args != null) { dialog.setCanceledOnTouchOutside(args.getBoolean(BaseDialogBuilder.ARG_CANCELABLE_ON_TOUCH_OUTSIDE)); } dialog.setOnShowListener(this); return dialog; }
From source file:com.application.treasurehunt.ScanQRCodeActivity.java
@Override public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); mLastLocation = savedInstanceState.getParcelable("lastLocation"); mLocationServicesChecked = savedInstanceState.getBoolean("mLocationServicesChecked"); }
From source file:com.fanfou.app.opensource.update.AppVersionInfo.java
public void readFromBundle(final Bundle bundle) { this.versionCode = bundle.getInt("versionCode"); this.versionName = bundle.getString("versionName"); this.releaseDate = bundle.getString("releaseDate"); this.changelog = bundle.getString("changelog"); this.downloadUrl = bundle.getString("downloadUrl"); this.versionType = bundle.getString("versionType"); this.packageName = bundle.getString("packageName"); this.forceUpdate = bundle.getBoolean("forceUpdate"); }
From source file:com.nextgis.mobile.map.MapBase.java
/** * Create handler for messages//from ww w .j av a2s . com */ protected void createHandler() { mHandler = new Handler() { public void handleMessage(Message msg) { super.handleMessage(msg); Bundle resultData = msg.getData(); boolean bHasErr = resultData.getBoolean(BUNDLE_HASERROR_KEY); if (bHasErr) { reportError(resultData.getString(BUNDLE_MSG_KEY)); } else { processMessage(resultData); } } }; }