Bundle putBoolean - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle putBoolean method.

This code example shows how to use the following methods:putBoolean, putInt
    } 
 
    @Override 
    public Bundle onSaveInstanceState() {
        Bundle state = super.onSaveInstanceState();
        state.putInt(YEAR, mDatePicker.getYear());
        state.putInt(MONTH, mDatePicker.getMonth());
        state.putInt(DAY, mDatePicker.getDayOfMonth());
        state.putBoolean(YEAR_OPTIONAL, mDatePicker.isYearOptional());
        return state;
    } 
 
    @Override 
    public void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        int year = savedInstanceState.getInt(YEAR);
        int month = savedInstanceState.getInt(MONTH);
        int day = savedInstanceState.getInt(DAY);
        boolean yearOptional = savedInstanceState.getBoolean(YEAR_OPTIONAL);
        mDatePicker.init(year, month, day, yearOptional, this);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:putBoolean
    } 
 
    @Override 
    public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features)
            throws NetworkErrorException { 
        final Bundle result = new Bundle();
        result.putBoolean(KEY_BOOLEAN_RESULT, false);
        return result;
    } 
 
    @Override 
    public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType,
            Bundle options) {
        return null; 
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:putBoolean
        mShortcutRequested = flag;
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBoolean(KEY_EDIT_MODE, mEditMode);
        outState.putBoolean(KEY_CREATE_CONTACT_ENABLED, mCreateContactEnabled);
        outState.putBoolean(KEY_SHORTCUT_REQUESTED, mShortcutRequested);
    } 
 
    @Override 
    public void restoreSavedState(Bundle savedState) {
        super.restoreSavedState(savedState);
 
        if (savedState == null) {
            return; 
        } 
 
        mEditMode = savedState.getBoolean(KEY_EDIT_MODE);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:putBoolean
	} 
 
	@Override 
	public Bundle hasFeatures(AccountAuthenticatorResponse response,
			Account account, String[] features) throws NetworkErrorException {
		final Bundle result = new Bundle();
		result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
		return result;
	} 
 
	@Override 
	public Bundle updateCredentials(AccountAuthenticatorResponse response,
			Account account, String authTokenType, Bundle loginOptions)
			throws NetworkErrorException { 
		return null; 
	} 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getBoolean, putBoolean
    assertEquals(Double.valueOf(7), Double.valueOf(bundle.getDouble("bar", 7)));
  } 
 
  @Test 
  public void testBoolean() { 
    bundle.putBoolean("foo", true);
    assertEquals(true, bundle.getBoolean("foo"));
    assertEquals(false, bundle.getBoolean("bar"));
    assertEquals(true, bundle.getBoolean("bar", true));
  } 
 
  @Test 
  public void testFloat() { 
    bundle.putFloat("foo", 5f);
    assertEquals(Float.valueOf(5), Float.valueOf(bundle.getFloat("foo")));
    assertEquals(Float.valueOf(0),Float.valueOf(bundle.getFloat("bar")));
    assertEquals(Float.valueOf(7), Float.valueOf(bundle.getFloat("bar", 7)));
  } 
 
  @Test 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:putBoolean, putString
This code example shows how to use the following methods:putBoolean
  @Override 
  protected void onSaveInstanceState(Bundle state) {
    String url = webView.getUrl();
    if (url != null && url.length() > 0) {
      webView.saveState(state);
      state.putBoolean(WEBVIEW_STATE_PRESENT, true);
    } 
  } 
 
  @Override 
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (webView.canGoBack()) {
        webView.goBack();
        return true; 
      } 
    } 
    return super.onKeyDown(keyCode, event);
  } 
 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getBoolean, putBoolean
        assertEquals(Double.valueOf(7), Double.valueOf(bundle.getDouble("bar", 7)));
    } 
 
    @Test 
    public void testBoolean() { 
        bundle.putBoolean("foo", true);
        assertEquals(true, bundle.getBoolean("foo"));
        assertEquals(false, bundle.getBoolean("bar"));
        assertEquals(true, bundle.getBoolean("bar", true));
    } 
 
    @Test 
    public void testFloat() { 
        bundle.putFloat("foo", 5f);
        assertEquals(Float.valueOf(5), Float.valueOf(bundle.getFloat("foo")));
        assertEquals(Float.valueOf(0),Float.valueOf(bundle.getFloat("bar")));
        assertEquals(Float.valueOf(7), Float.valueOf(bundle.getFloat("bar", 7)));
    } 
 
    @Test 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:putBoolean
     * will be passed to both). 
     * 
     * @param outState Bundle in which to place your saved state. 
     */ 
    public void onSaveInstanceState(Bundle outState) {
        outState.putBoolean("SlidingActivityHelper.open", mSlidingMenu.isMenuShowing());
        outState.putBoolean("SlidingActivityHelper.secondary", mSlidingMenu.isSecondaryMenuShowing());
    } 
 
    /** 
     * Register the above content view. 
     * 
     * @param v      the above content view to register 
     * @param params LayoutParams for that view (unused) 
     */ 
    public void registerAboveContentView(View v, LayoutParams params) {
        if (!mBroadcasting)
            mViewAbove = v;
    } 
 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:putBoolean, putInt, putString
        return super.onOptionsItemSelected(item);
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
 
        outState.putBoolean(EXTRA_HAS_NEXT, mHasNext);
 
        outState.putInt(EXTRA_HAS_NEXT, mNextPage);
 
        if (getWrappedListAdapter() != null && getWrappedListAdapter().getAll() != null) { 
            final ArrayList<T> items = getWrappedListAdapter().getAll();
            outState.putString(EXTRA_LIST_ITEMS, GsonUtils.toJson(items));
        } 
    } 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Bundle putBoolean Questions & Answers:

putBoolean Method Overview
Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key.
See Code Examples for other Android Bundle Methods: