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:org.thomnichols.android.gmarks.WebViewLoginActivity.java

protected void onSaveInstanceState(Bundle outState) {
    if (this.webView != null) {
        final String currentURL = this.webView.getUrl();
        if (currentURL != null && currentURL.startsWith(twoFactorAuthURL)) {
            outState.putBoolean(KEY_PAUSED_FOR_TWO_FACTOR_AUTH, true);
            outState.putString(KEY_PAUSED_AT_URL, currentURL);
        }/*from w  w  w .  j ava2 s. co m*/
    }
    super.onSaveInstanceState(outState);
}

From source file:com.xargsgrep.portknocker.activity.EditHostActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt(KEY_SELECTED_TAB_INDEX, getSupportActionBar().getSelectedNavigationIndex());
    outState.putBoolean(KEY_SHOW_CANCEL_DIALOG, (cancelDialog != null && cancelDialog.isShowing()));
}

From source file:com.amansoni.tripbook.activity.LocationLookup.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    // Save whether the address has been requested.
    savedInstanceState.putBoolean(ADDRESS_REQUESTED_KEY, mAddressRequested);

    // Save the address string.
    savedInstanceState.putString(LOCATION_ADDRESS_KEY, mAddressOutput);
    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.tassadar.multirommgr.installfragment.InstallCard.java

@Override
public void onClick(View view) {
    switch (view.getId()) {
    case R.id.install_btn: {
        Bundle extras = new Bundle();

        Bundle bundle = new Bundle();
        bundle.putString("installation_type", "multirom");

        CheckBox b = (CheckBox) m_view.findViewById(R.id.install_multirom);
        bundle.putBoolean("install_multirom", b.isChecked());

        b = (CheckBox) m_view.findViewById(R.id.install_recovery);
        bundle.putBoolean("install_recovery", b.isChecked());

        b = (CheckBox) m_view.findViewById(R.id.install_kernel);
        bundle.putBoolean("install_kernel", b.isChecked());

        if (b.isChecked()) {
            Spinner s = (Spinner) m_view.findViewById(R.id.kernel_options);
            String name = (String) s.getAdapter().getItem(s.getSelectedItemPosition());
            bundle.putString("kernel_name", name);
        }//from   w w w .j a  v  a 2  s  .  c om

        extras.putBundle("installation_info", bundle);

        m_listener.startActivity(extras, MainActivity.ACT_INSTALL_MULTIROM, InstallActivity.class);
        break;
    }
    case R.id.changelog_btn: {
        Changelog[] logs = m_manifest.getChangelogs();
        String[] names = new String[logs.length];
        String[] urls = new String[logs.length];

        for (int i = 0; i < logs.length; ++i) {
            names[i] = logs[i].name;
            urls[i] = logs[i].url;
        }

        Bundle b = new Bundle();
        b.putStringArray("changelog_names", names);
        b.putStringArray("changelog_urls", urls);

        m_listener.startActivity(b, MainActivity.ACT_CHANGELOG, ChangelogActivity.class);
        break;
    }
    }
}

From source file:android.support.car.ui.CarNavExtender.java

@Override
public NotificationCompat.Builder extend(NotificationCompat.Builder builder) {
    Bundle b = new Bundle();
    b.putBoolean(EXTRA_IS_EXTENDED, true);
    b.putSerializable(EXTRA_CONTENT_ID, mContentId);
    b.putInt(EXTRA_TYPE, mType);//  ww w. ja v a  2  s .co  m
    b.putCharSequence(Notification.EXTRA_TITLE, mContentTitle);
    b.putCharSequence(Notification.EXTRA_TEXT, mContentText);
    b.putCharSequence(EXTRA_SUB_TEXT, mSubText);
    b.putParcelable(Notification.EXTRA_LARGE_ICON, mLargeIcon);
    b.putInt(EXTRA_ACTION_ICON, mActionIcon);
    b.putParcelable(EXTRA_CONTENT_INTENT, mContentIntent);
    b.putInt(EXTRA_COLOR, mColor);
    b.putInt(EXTRA_NIGHT_COLOR, mNightColor);
    b.putBoolean(EXTRA_STREAM_VISIBILITY, mShowInStream);
    b.putBoolean(EXTRA_HEADS_UP_VISIBILITY, mShowAsHeadsUp);
    b.putBoolean(EXTRA_IGNORE_IN_STREAM, mIgnoreInStream);
    builder.getExtras().putBundle(EXTRA_CAR_EXTENDER, b);
    return builder;
}

From source file:com.imalu.alyou.activity.ConsortialistFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    if (((MainActivity) getActivity()).isConflict)
        outState.putBoolean("isConflict", true);
    super.onSaveInstanceState(outState);

}

From source file:com.android.gallery3d.app.Gallery.java

private void startViewAction(Intent intent) {
    Boolean slideshow = intent.getBooleanExtra(EXTRA_SLIDESHOW, false);
    getStateManager().setLaunchGalleryOnTop(true);
    if (slideshow) {
        getActionBar().hide();/* w  w w. j a  v  a 2s  .  c om*/
        DataManager manager = getDataManager();
        Path path = manager.findPathByUri(intent.getData());
        if (path == null || manager.getMediaObject(path) instanceof MediaItem) {
            path = Path.fromString(manager.getTopSetPath(DataManager.INCLUDE_IMAGE));
        }
        Bundle data = new Bundle();
        data.putString(SlideshowPage.KEY_SET_PATH, path.toString());
        data.putBoolean(SlideshowPage.KEY_RANDOM_ORDER, true);
        data.putBoolean(SlideshowPage.KEY_REPEAT, true);
        getStateManager().startState(SlideshowPage.class, data);
    } else {
        Bundle data = new Bundle();
        DataManager dm = getDataManager();
        Uri uri = intent.getData();
        String contentType = getContentType(intent);
        if (contentType == null) {
            Toast.makeText(this, R.string.no_such_item, Toast.LENGTH_LONG).show();
            finish();
            return;
        }
        if (uri == null) {
            int typeBits = GalleryUtils.determineTypeBits(this, intent);
            data.putInt(KEY_TYPE_BITS, typeBits);
            data.putString(AlbumSetPage.KEY_MEDIA_PATH, getDataManager().getTopSetPath(typeBits));
            getStateManager().setLaunchGalleryOnTop(true);
            getStateManager().startState(AlbumSetPage.class, data);
        } else if (contentType.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE)) {
            int mediaType = intent.getIntExtra(KEY_MEDIA_TYPES, 0);
            if (mediaType != 0) {
                uri = uri.buildUpon().appendQueryParameter(KEY_MEDIA_TYPES, String.valueOf(mediaType)).build();
            }
            Path setPath = dm.findPathByUri(uri);
            MediaSet mediaSet = null;
            if (setPath != null) {
                mediaSet = (MediaSet) dm.getMediaObject(setPath);
            }
            if (mediaSet != null) {
                if (mediaSet.isLeafAlbum()) {
                    data.putString(AlbumPage.KEY_MEDIA_PATH, setPath.toString());
                    getStateManager().startState(AlbumPage.class, data);
                } else {
                    data.putString(AlbumSetPage.KEY_MEDIA_PATH, setPath.toString());
                    getStateManager().startState(AlbumSetPage.class, data);
                }
            } else {
                startDefaultPage();
            }
        } else {
            Path itemPath = dm.findPathByUri(uri);
            Path albumPath = dm.getDefaultSetOf(itemPath);
            // TODO: Make this parameter public so other activities can reference it.
            boolean singleItemOnly = intent.getBooleanExtra("SingleItemOnly", false);
            if (!singleItemOnly && albumPath != null) {
                data.putString(PhotoPage.KEY_MEDIA_SET_PATH, albumPath.toString());
            }
            data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString());
            getStateManager().startState(PhotoPage.class, data);
        }
    }
}

From source file:be.evias.cloudLogin.cloudLoginRunPointActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    boolean isActiveAccount = mPrefs.getBoolean("cloudlogin_active_account", false);

    super.onSaveInstanceState(outState);
    if ((mAlertDialog != null && mAlertDialog.isShowing()) || !isActiveAccount)
        outState.putBoolean(STATE_DIALOG, true);
}

From source file:com.facebook.android.friendsmash.HomeActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    // Save the logged-in state
    outState.putBoolean(FriendSmashApplication.getLoggedInKey(),
            ((FriendSmashApplication) getApplication()).isLoggedIn());

    // Save the currentFBUser
    if (((FriendSmashApplication) getApplication()).getCurrentFBUser() != null) {
        outState.putString(FriendSmashApplication.getCurrentFbUserKey(),
                ((FriendSmashApplication) getApplication()).getCurrentFBUser().getInnerJSONObject().toString());
    }/*from w ww.j  a  va  2 s  .  com*/

    // Save the logged-in user's list of friends
    if (((FriendSmashApplication) getApplication()).getFriends() != null) {
        outState.putStringArrayList(FriendSmashApplication.getFriendsKey(),
                ((FriendSmashApplication) getApplication()).getFriendsAsArrayListOfStrings());
    }
}

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

/** Called when the activity is first created. */
@Override/*from  w w w .  ja v a  2 s . c om*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blog_content_view);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Bundle bundle = getIntent().getExtras();
    blog = (Blog) bundle.get("blog");

    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 (blog.getTime_stamp().equals("0")) {
        this.getBlogAdapter();
    }

    initView();
    // get comment fragment
    Bundle comment = new Bundle();
    comment.putString("type", "blog");
    comment.putInt("itemId", blog.getBlog_id());
    comment.putInt("totalComment", blog.getTotal_comment());
    comment.putInt("total_like", blog.getTotal_like());
    comment.putBoolean("no_share", blog.getShare());
    comment.putBoolean("is_liked", blog.getIs_like());
    comment.putBoolean("can_post_comment", blog.isCanPostComment());

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