Example usage for android.os Bundle putBundle

List of usage examples for android.os Bundle putBundle

Introduction

In this page you can find the example usage for android.os Bundle putBundle.

Prototype

public void putBundle(@Nullable String key, @Nullable Bundle value) 

Source Link

Document

Inserts a Bundle value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:de.elanev.studip.android.app.frontend.courses.CourseViewActivity.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putBundle(INTENT_EXTRAS, sExtras);
    super.onSaveInstanceState(outState);
}

From source file:com.google.android.apps.muzei.api.internal.SourceState.java

public Bundle toBundle() {
    Bundle bundle = new Bundle();
    if (mCurrentArtwork != null) {
        bundle.putBundle("currentArtwork", mCurrentArtwork.toBundle());
    }//from w  ww  .  j a v a 2s. c  o m
    bundle.putString("description", mDescription);
    bundle.putBoolean("wantsNetworkAvailable", mWantsNetworkAvailable);
    String[] commandsSerialized = new String[mUserCommands.size()];
    for (int i = 0; i < commandsSerialized.length; i++) {
        commandsSerialized[i] = mUserCommands.get(i).serialize();
    }
    bundle.putStringArray("userCommands", commandsSerialized);
    return bundle;
}

From source file:org.klnusbaum.udj.containers.Player.java

public Bundle bundleUp() {
    Bundle toReturn = new Bundle();
    toReturn.putString(ID_PARAM, getId());
    toReturn.putString(NAME_PARAM, getName());
    toReturn.putBundle(OWNER_PARAM, getOwner().bundleUp());
    toReturn.putDouble(LATITUDE_PARAM, getLatitude());
    toReturn.putDouble(LONGITUDE_PARAM, getLongitude());
    toReturn.putBoolean(HAS_PASSWORD_PARAM, getHasPassword());
    return toReturn;
}

From source file:android.support.v7.app.MediaRouteChooserDialogFragment.java

/**
 * Sets the media route selector for filtering the routes that the user can select.
 * This method must be called before the fragment is added.
 *
 * @param selector The selector to set.//  ww w .jav  a 2s . c om
 */
public void setRouteSelector(MediaRouteSelector selector) {
    if (selector == null) {
        throw new IllegalArgumentException("selector must not be null");
    }

    ensureRouteSelector();
    if (!mSelector.equals(selector)) {
        mSelector = selector;

        Bundle args = getArguments();
        if (args == null) {
            args = new Bundle();
        }
        args.putBundle(ARGUMENT_SELECTOR, selector.asBundle());
        setArguments(args);

        MediaRouteChooserDialog dialog = (MediaRouteChooserDialog) getDialog();
        if (dialog != null) {
            dialog.setRouteSelector(selector);
        }
    }
}

From source file:com.btmura.android.reddit.app.MessageThingListController.java

@Override
public void saveInstanceState(Bundle outState) {
    outState.putBundle(EXTRA_CURSOR_EXTRAS, cursorExtras);
}

From source file:com.gh4a.fragment.PagedDataBaseFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (mIterator != null) {
        outState.putBundle(STATE_KEY_ITERATOR_STATE, mIterator.saveState());
    }//from w  w w. jav a2 s  .c  o  m
}

From source file:com.ute.bihapi.wydarzeniatekstowe.thirdScreenActivities.ContactsListActivity.java

/**
 * This interface callback lets the main contacts list fragment notify
 * this activity that a contact has been selected.
 *
 * @param contactUri The contact Uri to the selected contact.
 *///w w  w . ja v a  2  s  . c o  m
@Override
public void onContactSelected(Uri contactUri) {
    String id = null, name = null, phone = null, hasPhone = null;
    int idx;
    Cursor cursor = getContentResolver().query(contactUri, null, null, null, null);
    if (cursor.moveToFirst()) {
        idx = cursor.getColumnIndex(ContactsContract.Contacts._ID);
        id = cursor.getString(idx);

        idx = cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
        name = cursor.getString(idx);

        idx = cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER);
        hasPhone = cursor.getString(idx);
    }
    // Get phone number - if they have one
    if ("1".equalsIgnoreCase(hasPhone)) {
        cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
                ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + id, null, null);
        if (cursor.moveToFirst()) {
            int colIdx = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
            phone = cursor.getString(colIdx);
        }
        cursor.close();
    }
    Log.i("Phone number", name + ": " + phone);

    Bundle mp = new Bundle();
    mp.putString(name, phone);
    Toast.makeText(getBaseContext(), "Wybrano osob: " + name + " ( " + phone + " )", Toast.LENGTH_SHORT)
            .show();
    Bundle extras = new Bundle();
    extras.putBundle("Person", mp);

    returnToParentActivity(extras);
    //Set up onClick - return to previous activity
}

From source file:com.money.manager.ex.reports.IncomeVsExpensesChartFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBundle(KEY_SAVED_INSTANCE, getChartArguments());
    outState.putBoolean(KEY_DISPLAY_AS_UP_ENABLED, isDisplayHomeAsUpEnabled());
}

From source file:com.fastbootmobile.encore.app.ArtistActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBundle(EXTRA_RESTORE_INTENT, mInitialIntent);
    Utils.queueBitmap(BITMAP_ARTIST_HERO, mHero);
}

From source file:android.support.v7.app.MediaRouteDiscoveryFragment.java

/**
 * Sets the media route selector for filtering the routes to be discovered.
 * This method must be called before the fragment is added.
 *
 * @param selector The selector to set./* w w w . ja  v a  2  s.c  om*/
 */
public void setRouteSelector(MediaRouteSelector selector) {
    if (selector == null) {
        throw new IllegalArgumentException("selector must not be null");
    }

    ensureRouteSelector();
    if (!mSelector.equals(selector)) {
        mSelector = selector;

        Bundle args = getArguments();
        if (args == null) {
            args = new Bundle();
        }
        args.putBundle(ARGUMENT_SELECTOR, selector.asBundle());
        setArguments(args);

        if (mCallback != null) {
            mRouter.removeCallback(mCallback);
            mRouter.addCallback(mSelector, mCallback, onPrepareCallbackFlags());
        }
    }
}