Example usage for android.os Bundle putBoolean

List of usage examples for android.os Bundle putBoolean

Introduction

In this page you can find the example usage for android.os Bundle putBoolean.

Prototype

public void putBoolean(@Nullable String key, boolean value) 

Source Link

Document

Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.android.contacts.activities.ActionBarAdapter.java

public void onSaveInstanceState(Bundle outState) {
    outState.putBoolean(EXTRA_KEY_SEARCH_MODE, mSearchMode);
    outState.putBoolean(EXTRA_KEY_SELECTED_MODE, mSelectionMode);
    outState.putString(EXTRA_KEY_QUERY, mQueryString);
    outState.putInt(EXTRA_KEY_SELECTED_TAB, mCurrentTab);
}

From source file:rpassmore.app.fillthathole.ViewHazardActivity.java

public void locateClickHandler(View view) {
    // display location map activity
    Intent myIntent = new Intent(view.getContext(), LocationActivity.class);

    Bundle bundle = new Bundle();
    if (hazard.getState() != Hazard.State.UNSUBMITTED) {
        bundle.putBoolean(LocationActivity.LOCATION_CAN_DRAG, false);
    } else {/*  w  ww  .j  a  v a 2s  .c o  m*/
        bundle.putBoolean(LocationActivity.LOCATION_CAN_DRAG, true);
    }

    if (hazard.getLattitude() != null && hazard.getLongitude() != null) {
        bundle.putLong(LocationActivity.LOCATION_LAT, (long) (hazard.getLattitude() * 1E6));
        bundle.putLong(LocationActivity.LOCATION_LONG, (long) (hazard.getLongitude() * 1E6));
        bundle.putBoolean(LocationActivity.LOCATION_CAN_CREATE, false);
    } else {
        bundle.putBoolean(LocationActivity.LOCATION_CAN_CREATE, true);
    }

    myIntent.putExtras(bundle);
    startActivityForResult(myIntent, LOCATION_MAP_ACTIVITY);
}

From source file:com.ruesga.rview.fragments.EditorFragment.java

public static EditorFragment newInstance(int legacyChangeId, String changeId, String revisionId, String file,
        String content, boolean readOnly) {
    EditorFragment fragment = new EditorFragment();
    Bundle arguments = new Bundle();
    arguments.putInt(Constants.EXTRA_LEGACY_CHANGE_ID, legacyChangeId);
    arguments.putString(Constants.EXTRA_CHANGE_ID, changeId);
    arguments.putString(Constants.EXTRA_REVISION_ID, revisionId);
    if (!TextUtils.isEmpty(file)) {
        arguments.putString(Constants.EXTRA_FILE, file);
    }// w ww.j  av  a 2 s  . c  om
    if (!TextUtils.isEmpty(content)) {
        arguments.putString(Constants.EXTRA_CONTENT_FILE, content);
    }
    arguments.putBoolean(Constants.EXTRA_READ_ONLY, readOnly);
    fragment.setArguments(arguments);
    return fragment;
}

From source file:com.brodev.socialapp.view.MarketPlaceDetail.java

/** Called when the activity is first created. */
@Override/*from  w w  w .ja  va  2s.c o m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.market_place_content_view);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Bundle bundle = getIntent().getExtras();
    marketPlace = (MarketPlace) bundle.get("marketplace");

    phraseManager = new PhraseManager(getApplicationContext());
    user = (User) getApplicationContext();
    colorView = new ColorView(getApplicationContext());
    this.imageGetter = new ImageGetter(getApplicationContext());

    if (android.os.Build.VERSION.SDK_INT > 9) {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
    }

    if (marketPlace.getTime_stamp().equals("0")) {
        this.getMarketPlaceAdapter();
    }

    getSupportActionBar().setTitle(phraseManager.getPhrase(getApplicationContext(), "marketplace.marketplace"));
    initView();

    // get comment fragment
    Bundle comment = new Bundle();
    comment.putString("type", "marketplace");
    comment.putInt("itemId", marketPlace.getListing_id());
    comment.putInt("totalComment", marketPlace.getTotal_comment());
    comment.putInt("total_like", marketPlace.getTotal_like());
    comment.putBoolean("no_share", false);
    comment.putBoolean("is_liked", marketPlace.getIs_liked());
    comment.putBoolean("can_post_comment", marketPlace.getCan_post_comment());

    CommentFragment commentFragment = new CommentFragment();
    commentFragment.setArguments(comment);
    getSupportFragmentManager().beginTransaction().add(R.id.commentfragment_wrap, commentFragment).commit();
}

From source file:net.sf.diningout.app.ui.FriendsFragment.java

@Override
public void onResume() {
    super.onResume();
    Bundle extras = new Bundle();
    extras.putBoolean(SYNC_EXTRAS_CONTACTS_ONLY, true);
    Content.requestSyncNow(Accounts.selected(), AUTHORITY, extras);
}

From source file:com.android.camera.settings.CameraSettingsActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FatalErrorHandler fatalErrorHandler = new FatalErrorHandlerImpl(this);
    boolean hideAdvancedScreen = false;

    try {/*from  ww w  . j  a v  a 2 s.c  o m*/
        mOneCameraManager = OneCameraModule.provideOneCameraManager();
    } catch (OneCameraException e) {
        // Log error and continue. Modules requiring OneCamera should check
        // and handle if null by showing error dialog or other treatment.
        fatalErrorHandler.onGenericCameraAccessFailure();
    }

    // Check if manual exposure is available, so we can decide whether to
    // display Advanced screen.
    try {
        CameraId frontCameraId = mOneCameraManager.findFirstCameraFacing(Facing.FRONT);
        CameraId backCameraId = mOneCameraManager.findFirstCameraFacing(Facing.BACK);

        // The exposure compensation is supported when both of the following conditions meet
        //   - we have the valid camera, and
        //   - the valid camera supports the exposure compensation
        boolean isExposureCompensationSupportedByFrontCamera = (frontCameraId != null) && (mOneCameraManager
                .getOneCameraCharacteristics(frontCameraId).isExposureCompensationSupported());
        boolean isExposureCompensationSupportedByBackCamera = (backCameraId != null) && (mOneCameraManager
                .getOneCameraCharacteristics(backCameraId).isExposureCompensationSupported());

        // Hides the option if neither front and back camera support exposure compensation.
        if (!isExposureCompensationSupportedByFrontCamera && !isExposureCompensationSupportedByBackCamera) {
            hideAdvancedScreen = true;
        }
    } catch (OneCameraAccessException e) {
        fatalErrorHandler.onGenericCameraAccessFailure();
    }

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(R.string.mode_settings);

    String prefKey = getIntent().getStringExtra(PREF_SCREEN_EXTRA);
    CameraSettingsFragment dialog = new CameraSettingsFragment();
    Bundle bundle = new Bundle(1);
    bundle.putString(PREF_SCREEN_EXTRA, prefKey);
    bundle.putBoolean(HIDE_ADVANCED_SCREEN, hideAdvancedScreen);
    dialog.setArguments(bundle);
    getFragmentManager().beginTransaction().replace(android.R.id.content, dialog).commit();
}

From source file:app.hacked.MainActivity.java

@Override
public void onChallengeItemSelected(ChallengeItem challenge) {
    if (findViewById(R.id.ChallengeDetails) != null) {
        mTwoPane = true;//  w  w  w. j  a va  2 s .co  m
        Bundle arguments = new Bundle();
        arguments.putString(ChallengeDetailsFragment.TITLE, challenge.ChallengeTitle);
        arguments.putString(ChallengeDetailsFragment.DETAILS, challenge.ChallengeContent);
        arguments.putBoolean(ProjectDetailsFragment.ARG_2PANE, true);
        ChallengeDetailsFragment fragment = new ChallengeDetailsFragment();
        fragment.setArguments(arguments);
        getSupportFragmentManager().beginTransaction().replace(R.id.ChallengeDetails, fragment).commit();
    } else {
        mTwoPane = false;
        Intent detailIntent = new Intent(this, ChallengeDetailsActivity.class);
        detailIntent.putExtra(ChallengeDetailsFragment.TITLE, challenge.ChallengeTitle);
        detailIntent.putExtra(ChallengeDetailsFragment.DETAILS, challenge.ChallengeContent);
        detailIntent.putExtra(ProjectDetailsFragment.ARG_2PANE, false);
        startActivity(detailIntent);
    }
}

From source file:com.radicaldynamic.groupinform.activities.AccountFolderList.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(KEY_COPY_TO_FOLDER, mCopyToFolder);
    outState.putString(KEY_FOLDER_ID, mSelectedFolderId);
    outState.putString(KEY_FOLDER_NAME, mSelectedFolderName);
}

From source file:cmu.cconfs.instantMessage.activities.ContactlistFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (((IMMainActivity) getActivity()).isConflict) {
        outState.putBoolean("isConflict", true);
    } else if (((IMMainActivity) getActivity()).getCurrentAccountRemoved()) {
        outState.putBoolean(Constant.ACCOUNT_REMOVED, true);
    }//from   www .j a v a 2s  .  co m

}

From source file:de.geeksfactory.opacclient.frontend.OpacActivity.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean("twoPane", twoPane);
    if (fragment != null)
        getSupportFragmentManager().putFragment(outState, "fragment", fragment);
    if (mTitle != null)
        outState.putCharSequence("title", mTitle);
}