Bundle getBoolean - 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 getBoolean method.

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
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBoolean
        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);
        mCreateContactEnabled = savedState.getBoolean(KEY_CREATE_CONTACT_ENABLED);
        mShortcutRequested = savedState.getBoolean(KEY_SHORTCUT_REQUESTED);
    } 
 
    @Override 
    protected void onCreateView(LayoutInflater inflater, ViewGroup container) {
        super.onCreateView(inflater, container);
        if (mCreateContactEnabled) {
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBoolean
    @Override 
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        ListAdapter adapter = getListAdapter();
        if (adapter instanceof ListAdapterWithProgress<?>) {
            boolean isLoading = savedInstanceState.getBoolean(IS_BUSY_EXTRA);
            ((ListAdapterWithProgress<?>) adapter).setIsLoadingData(isLoading);
        } 
        wasInterrupted = true;
    } 
 
    @Override 
    protected void onPause() { 
        super.onPause(); 
        wasCreated = wasInterrupted = false;
    } 
 
    @Override 
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBoolean, getString
        if (extras == null) {
            ComposeMessageActivity.log("Called to send SMS but no extras"); 
            return; 
        } 
 
        String message = extras.getString(Intent.EXTRA_TEXT);
 
        Uri intentUri = intent.getData();
        String recipients = Conversation.getRecipients(intentUri);
 
        if (TextUtils.isEmpty(recipients)) {
            ComposeMessageActivity.log("Recipient(s) cannot be empty"); 
            return; 
        } 
        if (extras.getBoolean("showUI", false)) {
            intent.setClassName(this, "com.android.mms.ui.ComposeMessageActivityNoLockScreen");
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
        } else { 
            if (TextUtils.isEmpty(message)) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBoolean
                    ? extras.getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)
                    : null)); 
        } 
        // Check if the Cursor indicates that the query is not complete and show the spinner 
        if (extras != null
                && extras.getBoolean(SearchManager.CURSOR_EXTRA_KEY_IN_PROGRESS)) {
            // mSearchView.getWindow().getDecorView().post(mStartSpinnerRunnable); // TODO: 
            return; 
        } 
        // If cursor is null or is done, stop the spinner 
        // mSearchView.getWindow().getDecorView().post(mStopSpinnerRunnable); // TODO: 
    } 
 
    /** 
     * Cache columns. 
     */ 
    @Override 
    public void changeCursor(Cursor c) {
        if (DBG) Log.d(LOG_TAG, "changeCursor(" + c + ")");
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBoolean, getString
This code example shows how to use the following methods:getBoolean, getInt
    } 
 
    @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);
        updateTitle(year, month, day);
    } 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:containsKey, getBoolean
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
 
		if (savedInstanceState != null && savedInstanceState.containsKey(ONSCREEN_CALCULATOR_ENABLED)) {
			onscreenCalculatorEnabled = savedInstanceState.getBoolean(ONSCREEN_CALCULATOR_ENABLED);
		} 
 
		if (onscreenCalculatorEnabled == null) {
			onscreenCalculatorEnabled = getArguments().getBoolean(ONSCREEN_CALCULATOR_ENABLED, CalculatorPreferences.OnscreenCalculator.showAppIcon.getDefaultValue());
		} 
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		return inflater.inflate(R.layout.cpp_wizard_step_onscreen, null);
	} 
 
	@Override 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBoolean, getString
 
    protected void loadScript() { 
        try { 
            if (scriptName != null) {
                new Script(scriptName).execute();
            } else if (configBundle != null && configBundle.getString("Remote Variable") != null) {
                setRemoteVariable(configBundle.getString("Remote Variable"));
                if (configBundle.getBoolean("Define Remote Variable")) {
                    JRubyAdapter.put(remoteVariable, this);
                } 
                if (configBundle.getString("Initialize Script") != null) {
                    JRubyAdapter.execute(configBundle.getString("Initialize Script"));
                } 
                JRubyAdapter.execute(getRemoteVariableCall("on_create($bundle)")); 
            } else { 
                throw new RuntimeException("Neither script name nor remote variable was set.");
            } 
        } catch(IOException e){
            e.printStackTrace();
            ProgressDialog.show(this, "Script failed", "Something bad happened", true, true);
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Bundle getBoolean Questions & Answers:

getBoolean Method Overview
Returns the value associated with the given key, or false if no mapping of the desired type exists for the given key.
See Code Examples for other Android Bundle Methods: