List of usage examples for android.os Bundle putBoolean
public void putBoolean(@Nullable String key, boolean value)
From source file:com.taw.gotothere.GoToThereActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { // Superclass handles map type, centre point of map and zoom level super.onSaveInstanceState(outState); Log.d(TAG, "onSaveInstanceState()"); GeoPoint pt = null;// w w w. j av a2 s. c o m pt = navigationOverlay.getSelectedLocation(); if (pt != null) { outState.putInt(END_LAT_KEY, pt.getLatitudeE6()); outState.putInt(END_LONG_KEY, pt.getLongitudeE6()); } pt = navigationOverlay.getStartLocation(); if (pt != null) { outState.putInt(START_LAT_KEY, pt.getLatitudeE6()); outState.putInt(START_LONG_KEY, pt.getLongitudeE6()); } // Whether we're placing a marker to navigate to outState.putBoolean(PLACING_MARKER_KEY, placingMarker); // Whether we're navigating to a point outState.putBoolean(NAVIGATING_KEY, navigating); if (navigating) { outState.putSerializable(DIRECTIONS_KEY, navigationOverlay.getDirections()); } SharedPreferences.Editor edit = getPreferences(Activity.MODE_PRIVATE).edit(); edit.putString(PREVIOUS_QUERY, searchTextView.getText().toString()).commit(); }
From source file:jp.mixi.android.sdk.MixiContainerImpl.java
/** * PaymentParameterintent?bundle??//from w w w .ja va2 s . com * * @param param * @return */ private Bundle convertPaymentBundle(PaymentParameter param) { Bundle bundle = new Bundle(); bundle.putString(PaymentParameter.CLIENT_ID_NAME, mClientId); bundle.putString(PaymentParameter.CALLBACK_URL_NAME, param.callbackUrl); bundle.putString(PaymentParameter.INVENTORY_CODE_NAME, param.inventoryCode); bundle.putBoolean(PaymentParameter.IS_TEST_NAME, param.isTest); bundle.putString(PaymentParameter.ITEM_ID_NAME, param.itemId); bundle.putString(PaymentParameter.ITEM_NAME_NAME, param.itemName); bundle.putInt(PaymentParameter.ITEM_PRICE_NAME, param.itemPrice); bundle.putString(PaymentParameter.SIGNATURE_NAME, param.signature); bundle.putInt(PaymentParameter.VERSION_NAME, param.getVertion()); return bundle; }
From source file:com.amaze.filemanager.services.CopyService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { Bundle b = new Bundle(); ArrayList<BaseFile> files = intent.getParcelableArrayListExtra("FILE_PATHS"); String FILE2 = intent.getStringExtra("COPY_DIRECTORY"); int mode = intent.getIntExtra("MODE", 0); mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); b.putInt("id", startId); Intent notificationIntent = new Intent(this, MainActivity.class); notificationIntent.setAction(Intent.ACTION_MAIN); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); notificationIntent.putExtra("openprocesses", true); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); mBuilder = new NotificationCompat.Builder(c); mBuilder.setContentIntent(pendingIntent); mBuilder.setContentTitle(getResources().getString(R.string.copying)) .setSmallIcon(R.drawable.ic_content_copy_white_36dp); if (foreground) { startForeground(Integer.parseInt("456" + startId), mBuilder.build()); foreground = false;//from www.jav a 2 s .c o m } b.putBoolean("move", intent.getBooleanExtra("move", false)); b.putString("FILE2", FILE2); b.putInt("MODE", mode); b.putParcelableArrayList("files", files); hash.put(startId, true); DataPackage intent1 = new DataPackage(); intent1.setName(files.get(0).getName()); intent1.setTotal(0); intent1.setDone(0); intent1.setId(startId); intent1.setP1(0); intent1.setP2(0); intent1.setMove(intent.getBooleanExtra("move", false)); intent1.setCompleted(false); hash1.put(startId, intent1); //going async new DoInBackground().execute(b); // If we get killed, after returning from here, restart return START_STICKY; }
From source file:com.android.contacts.list.DefaultContactBrowseListFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // Clear the listener to make sure we don't get callbacks after onSaveInstanceState, // in order to avoid doing fragment transactions after it. // TODO Figure out a better way to deal with the issue (ag/120686). if (mActionBarAdapter != null) { mActionBarAdapter.setListener(null); mActionBarAdapter.onSaveInstanceState(outState); }/*from w w w . java 2s .c o m*/ mDisableOptionItemSelected = true; outState.putBoolean(KEY_DELETION_IN_PROGRESS, mIsDeletionInProgress); outState.putBoolean(KEY_SEARCH_RESULT_CLICKED, mSearchResultClicked); }
From source file:com.ichi2.anki.NoteEditor.java
@Override protected void onSaveInstanceState(Bundle savedInstanceState) { Timber.i("Saving instance"); savedInstanceState.putInt("caller", mCaller); savedInstanceState.putBoolean("addFact", mAddNote); savedInstanceState.putLong("did", mCurrentDid); savedInstanceState.putStringArray("tags", mSelectedTags.toArray(new String[mSelectedTags.size()])); Bundle fields = new Bundle(); // Save the content of all the note fields. We use the field's ord as the key to // easily map the fields correctly later. for (FieldEditText e : mEditFields) { fields.putString(Integer.toString(e.getOrd()), e.getText().toString()); }/*from w ww.j av a2s . com*/ savedInstanceState.putBundle("editFields", fields); super.onSaveInstanceState(savedInstanceState); }
From source file:es.upv.riromu.arbre.main.MainActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { FileOutputStream fos;/* www . ja va2 s . co m*/ if (image != null) { try { String fileName = "temp_image.jpg"; String fileURL = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) .getPath() + "/" + fileName; fos = new FileOutputStream(fileURL); image.compress(Bitmap.CompressFormat.JPEG, compressRatio, fos); outState.putBoolean("image", true); image.recycle(); System.gc(); } catch (Exception e) { Log.e(TAG, "Error " + e.getMessage()); } } if (state[CROP_IMAGE]) { try { String fileName = "temp_cropped.jpg"; String fileURL = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) .getPath() + "/" + fileName; fos = new FileOutputStream(fileURL); croppedimage.compress(Bitmap.CompressFormat.JPEG, 100, fos); outState.putBoolean("croppedimage", true); fos.close(); croppedimage.recycle(); System.gc(); } catch (Exception e) { Log.e(TAG, "Error " + e.getMessage()); } } if (state[TREAT_IMAGE]) { try { String fileName = "temp_treated.jpg"; String fileURL = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) .getPath() + "/" + fileName; fos = new FileOutputStream(fileURL); ImageView imv = (ImageView) findViewById(R.id.image_intro); ((BitmapDrawable) imv.getDrawable()).getBitmap().compress(Bitmap.CompressFormat.JPEG, 100, fos); outState.putBoolean("treatedimage", true); fos.close(); } catch (Exception e) { Log.e(TAG, "Error " + e.getMessage()); } } if (image_uri != null) { outState.putString("image_uri", image_uri.getPath()); } outState.putIntArray("colours", colours); outState.putBoolean("cropping", state[CROP_IMAGE]); outState.putBoolean("treated", state[TREAT_IMAGE]); super.onSaveInstanceState(outState); }
From source file:com.owncloud.android.ui.activity.FileDisplayActivity.java
private void startSynchronization() { ContentResolver.cancelSync(null, AccountAuthenticator.AUTHORITY); // cancel // the // current // synchronizations // of // any // ownCloud // account Bundle bundle = new Bundle(); bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); ContentResolver.requestSync(getAccount(), AccountAuthenticator.AUTHORITY, bundle); shareDetailsSync();// w ww. j a v a 2 s .co m }
From source file:com.irccloud.android.activity.LoginActivity.java
@Override public void onSaveInstanceState(Bundle state) { super.onSaveInstanceState(state); if (login != null && login.getVisibility() == View.VISIBLE) { if (email != null) state.putString("email", email.getText().toString()); if (password != null) state.putString("password", password.getText().toString()); if (host != null) state.putString("host", host.getText().toString()); if (name != null) state.putString("name", name.getText().toString()); if (signupBtn != null) state.putBoolean("signup", signupBtn.getVisibility() == View.VISIBLE); if (loginBtn != null) state.putBoolean("login", loginBtn.getVisibility() == View.VISIBLE); if (sendAccessLinkBtn != null) state.putBoolean("forgotPassword", sendAccessLinkBtn.getVisibility() == View.VISIBLE); }/* ww w . ja v a 2 s . c o m*/ state.putBoolean("resolving_error", mResolvingError); }
From source file:se.leap.bitmaskclient.ProviderAPI.java
private Bundle getAndSetEipServiceJson() { Bundle result = new Bundle(); String eip_service_json_string = ""; if (go_ahead) { try {/* ww w . j ava2s . com*/ JSONObject provider_json = new JSONObject(preferences.getString(Provider.KEY, "")); String eip_service_url = provider_json.getString(Provider.API_URL) + "/" + provider_json.getString(Provider.API_VERSION) + "/" + EIP.SERVICE_API_PATH; eip_service_json_string = downloadWithProviderCA(eip_service_url); JSONObject eip_service_json = new JSONObject(eip_service_json_string); eip_service_json.getInt(Provider.API_RETURN_SERIAL); preferences.edit().putString(Constants.KEY, eip_service_json.toString()).commit(); result.putBoolean(RESULT_KEY, true); } catch (JSONException e) { String reason_to_fail = pickErrorMessage(eip_service_json_string); result.putString(ERRORS, reason_to_fail); result.putBoolean(RESULT_KEY, false); } } return result; }
From source file:com.github.chenxiaolong.dualbootpatcher.patcher.PatchFileFragment.java
/** * {@inheritDoc}// w w w.j a va2 s . co m */ @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(EXTRA_SELECTED_PATCHER_ID, mSelectedPatcherId); outState.putParcelable(EXTRA_SELECTED_INPUT_URI, mSelectedInputUri); outState.putParcelable(EXTRA_SELECTED_OUTPUT_URI, mSelectedOutputUri); outState.putString(EXTRA_SELECTED_INPUT_FILE_NAME, mSelectedInputFileName); outState.putLong(EXTRA_SELECTED_INPUT_FILE_SIZE, mSelectedInputFileSize); outState.putInt(EXTRA_SELECTED_TASK_ID, mSelectedTaskId); outState.putParcelable(EXTRA_SELECTED_DEVICE, mSelectedDevice); outState.putString(EXTRA_SELECTED_ROM_ID, mSelectedRomId); outState.putBoolean(EXTRA_QUERYING_METADATA, mQueryingMetadata); }