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

This code example shows how to use the following methods:getBundle, putBundle
 
  @Test 
  public void testBundle() { 
    Bundle innerBundle = new Bundle();
    innerBundle.putInt("int", 7);
    bundle.putBundle("bundle", innerBundle);
 
    assertEquals(innerBundle, bundle.getBundle("bundle"));
    assertNull(bundle.getBundle("bar"));
  } 
 
  @Test 
  public void testBooleanArray() { 
    boolean [] arr = new boolean[] { false, true };
    bundle.putBooleanArray("foo", arr);
 
    assertArrayEquals(arr, bundle.getBooleanArray("foo"));
    assertNull(bundle.getBooleanArray("bar"));
  } 
 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBundle, putBundle
 
    @Test 
    public void testBundle() { 
        Bundle innerBundle = new Bundle();
        innerBundle.putInt("int", 7);
        bundle.putBundle("bundle", innerBundle);
 
        assertEquals(innerBundle, bundle.getBundle("bundle"));
        assertNull(bundle.getBundle("bar"));
    } 
 
    @Test 
    public void testBooleanArray() { 
        boolean [] arr = new boolean[] { false, true };
        bundle.putBooleanArray("foo", arr);
 
        assertArrayEquals(arr, bundle.getBooleanArray("foo"));
        assertNull(bundle.getBooleanArray("bar"));
    } 
 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBundle, getLong
		if (savedInstanceState == null)
			return false; 
 
		try { 
 
			Bundle stateBundle = savedInstanceState.getBundle(EXTRA_WEBVIEW_STATE);
			if (stateBundle == null || stateBundle.size() == 0
					|| webViewBridge.restoreState(stateBundle) == null) {
				Log.w(TAG, "failed to restore webview state");
				return false; 
			} 
			if (Build.VERSION.SDK_INT <= 10) {
				Bundle pictureBundle = savedInstanceState
						.getBundle(EXTRA_WEBVIEW_PICTURE);
 
				if (pictureBundle == null) {
					Log.w(TAG, "failed to restore webview picture state.");
					return false; 
				} 
 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBundle
    return extras.getDouble(name, defaultValue);
  } 
 
  @Implementation 
  public Bundle getBundleExtra(String name) {
    return extras.getBundle(name);
  } 
 
  @Implementation 
  public float getFloatExtra(String name, float defaultValue) {
    return extras.getFloat(name, defaultValue);
  } 
 
  @Implementation 
  public byte[] getByteArrayExtra(String name) {
    return extras.getByteArray(name);
  } 
 
  @Implementation 
  public Serializable getSerializableExtra(String name) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBundle, getFloatArray
    } 
 
    @Override 
    protected void onRestoreInstanceState(Parcelable p) {
        Bundle b = (Bundle) p;
        super.onRestoreInstanceState(b.getBundle("super"));
        mLevels = b.getFloatArray("levels");
    } 
 
    @Override 
    protected void onAttachedToWindow() { 
        super.onAttachedToWindow(); 
 
        setLayerType(View.LAYER_TYPE_HARDWARE, null);
        buildLayer();
    } 
 
    /** 
     * Returns a color that is assumed to be blended against black background, 
     * assuming close to sRGB behavior of screen (gamma 2.2 approximation). 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBundle
        return extras.getDouble(name, defaultValue);
    } 
 
    @Implementation 
    public Bundle getBundleExtra(String name) {
        return extras.getBundle(name);
    } 
 
    @Implementation 
    public float getFloatExtra(String name, float defaultValue) {
        return extras.getFloat(name, defaultValue);
    } 
 
    @Implementation 
    public byte[] getByteArrayExtra(String name) {
        return extras.getByteArray(name);
    } 
 
    @Implementation 
    public Serializable getSerializableExtra(String name) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBundle
    if (DEBUG)
      Log.d(TAG, "onCreate(): " + getClass().getSimpleName());
 
    Bundle state = null;
    if (savedInstanceState != null) {
      state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
    } 
 
    mLocalActivityManager = new LocalActivityManager(getActivity(), true);
    mLocalActivityManager.dispatchCreate(state);
  } 
 
  @Override 
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBundle(KEY_STATE_BUNDLE, mLocalActivityManager.saveInstanceState());
  } 
 
  @Override 
  public void onResume() { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Bundle getBundle Questions & Answers:

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