Bundle putBundle - 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 putBundle 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
This code example shows how to use the following methods:putBundle, putLong
		if (webViewBridge.saveState(stateBundle) == null) {
			Log.w(TAG, "failed to save webview state");
			return; 
		} 
 
		outState.putBundle(EXTRA_WEBVIEW_STATE, stateBundle);
		 
		if (Build.VERSION.SDK_INT <= 10) {
			Bundle webViewPictureBundle = new Bundle();
			File tmp = new File(mContext.getCacheDir(), WEBVIEW_TMP_FILE + "."
					+ id);
			if (!webViewBridge.savePicture(webViewPictureBundle, tmp))
				Log.w(TAG, "failed to save webview picture");
			outState.putBundle(EXTRA_WEBVIEW_PICTURE, webViewPictureBundle);
			outState.putLong(EXTRA_WEBVIEW_ID, id);
		} 
	} 
} 
7
CodeRank
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
This code example shows how to use the following methods:putBundle, putString
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        Log_OC.d(SAML_DIALOG_TAG, "onSaveInstanceState being CALLED");
        super.onSaveInstanceState(outState);
         
        // save URLs 
        outState.putString(ARG_INITIAL_URL, mInitialUrl);
        outState.putString(ARG_TARGET_URL, mTargetUrl);
         
        // Save the state of the WebView 
        Bundle webviewState = new Bundle();
        mSsoWebView.saveState(webviewState);
        outState.putBundle(KEY_WEBVIEW_STATE, webviewState);
    } 
 
    @Override 
    public void onDestroyView() { 
        Log_OC.d(TAG, "onDestroyView");
7
CodeRank
This code example shows how to use the following methods:putBundle
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, Bundle value) {
    extras.putBundle(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, boolean value) {
    extras.putBoolean(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, int[] value) {
    extras.putIntArray(key, value);
    return realIntent;
  } 
6
CodeRank
This code example shows how to use the following methods:putBundle
        return realIntent;
    } 
 
    @Implementation 
    public Intent putExtra(String key, Bundle value) {
        extras.putBundle(key, value);
        return realIntent;
    } 
 
    @Implementation 
    public Intent putExtra(String key, boolean value) {
        extras.putBoolean(key, value);
        return realIntent;
    } 
 
    @Implementation 
    public Intent putExtra(String key, int[] value) {
        extras.putIntArray(key, value);
        return realIntent;
    } 
6
CodeRank
This code example shows how to use the following methods:putBundle
  } 
 
  @Override 
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBundle(KEY_STATE_BUNDLE, mLocalActivityManager.saveInstanceState());
  } 
 
  @Override 
  public void onResume() { 
    super.onResume(); 
    if (DEBUG)
      Log.d(TAG, "onResume(): " + getClass().getSimpleName());
    mLocalActivityManager.dispatchResume();
  } 
 
  @Override 
  public void onPause() { 
    super.onPause(); 
    if (DEBUG)
6
CodeRank
This code example shows how to use the following methods:putBundle
 
        // Now set up the bundle that will be inserted into the pending intent 
        // when it's time to do the search.  We always build it here (even if empty) 
        // because the voice search activity will always need to insert "QUERY" into 
        // it anyway. 
        Bundle queryExtras = new Bundle();
        if (appData != null) {
            queryExtras.putBundle(SearchManager.APP_DATA, appData);
        } 
 
        // Now build the intent to launch the voice search.  Add all necessary 
        // extras to launch the voice recognizer, and then all the necessary extras 
        // to forward the results to the searchable activity 
        Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        voiceIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
        // Add all of the configuration options supplied by the searchable's metadata 
        String languageModel = getString(mSearchable.getVoiceLanguageModeId());
        if (languageModel == null) {
            languageModel = RecognizerIntent.LANGUAGE_MODEL_FREE_FORM;
6
CodeRank
This code example shows how to use the following methods:putBundle
   * @param key a String, or null 
   * @param value a Bundle object, or null 
   * @return itself 
   */ 
  public TaskResult add(String key, Bundle value) {
    mBundle.putBundle(key, value);
    return this;
  } 
 
  /** 
   * Inserts all mappings from the given Bundle into this Bundle. 
   * 
   * @param bundle the bundle to map 
   * @return itself 
   */ 
  public TaskResult addAll(Bundle bundle) {
    mBundle.putAll(bundle);
    return this;
  } 
} 
5
CodeRank

Related Bundle putBundle Questions & Answers:

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