Example usage for android.os Bundle putAll

List of usage examples for android.os Bundle putAll

Introduction

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

Prototype

public void putAll(Bundle bundle) 

Source Link

Document

Inserts all mappings from the given Bundle into this Bundle.

Usage

From source file:cn.edu.zafu.corepage.core.CorePageManager.java

/**
 * ?//  w ww  .  j  av a 2 s. c o m
 * fragemnt
 *
 * @param fragmentManager FragmentManager?
 * @param pageName  ???
 * @param bundle ?
 * @param animations 
 * @param addToBackStack ?
 * @return Fragment
 */
public Fragment openPageWithNewFragmentManager(FragmentManager fragmentManager, String pageName, Bundle bundle,
        int[] animations, boolean addToBackStack) {
    BaseFragment fragment = null;
    try {
        CorePage corePage = this.mPageMap.get(pageName);
        if (corePage == null) {
            Log.d(TAG, "Page:" + pageName + " is null");
            return null;
        }
        /**
         * Atlas? start
         */
        if (CoreConfig.isOpenAtlas()) {
            ClassLoader bundleClassLoader = CoreConfig.getBundleClassLoader();
            if (bundleClassLoader == null) {
                Log.d(TAG, "OpenAtlas bundle ClassLoader is null!");
                return null;
            }
            fragment = (BaseFragment) CoreConfig.getBundleClassLoader().loadClass(corePage.getClazz())
                    .newInstance();
        } else {
            fragment = (BaseFragment) Class.forName(corePage.getClazz()).newInstance();
        }
        /**
         * Atlas? end
         */

        Bundle pageBundle = buildBundle(corePage);
        if (bundle != null) {
            pageBundle.putAll(bundle);
        }
        fragment.setArguments(pageBundle);
        fragment.setPageName(pageName);

        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        if (animations != null && animations.length >= 4) {
            fragmentTransaction.setCustomAnimations(animations[0], animations[1], animations[2], animations[3]);
        }
        Fragment fragmentContainer = fragmentManager.findFragmentById(R.id.fragment_container);
        if (fragmentContainer != null) {
            fragmentTransaction.hide(fragmentContainer);
        }

        fragmentTransaction.add(R.id.fragment_container, fragment, pageName);
        if (addToBackStack) {
            fragmentTransaction.addToBackStack(pageName);
        }

        fragmentTransaction.commitAllowingStateLoss();
        //fragmentTransaction.commit();

    } catch (Exception e) {
        e.printStackTrace();
        Log.d(TAG, "Fragment.error:" + e.getMessage());
        return null;
    }
    return fragment;
}

From source file:org.wheelmap.android.fragment.POIsMapsforgeFragment.java

public void startSearch(Bundle extras) {
    Bundle boundingBoxExtras = fillExtrasWithBoundingRect();
    extras.putAll(boundingBoxExtras);

    mWorkerFragment.executeSearch(extras);
}

From source file:de.aw.awlib.fragments.AWFragment.java

/**
 * Sichern des bereitgestellten Bundles args. Wird in onCreate() wiederhergestellt.
 *//*w w w .  ja  va2  s  .co  m*/
@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putAll(args);
    super.onSaveInstanceState(outState);
}

From source file:org.mariotaku.twidere.fragment.CursorStatusesFragment.java

protected void reloadStatuses() {
    if (getContext() == null || isDetached())
        return;/* w  ww  .ja  v  a  2 s.  c o m*/
    final Bundle args = new Bundle(), fragmentArgs = getArguments();
    if (fragmentArgs != null) {
        args.putAll(fragmentArgs);
        args.putBoolean(EXTRA_FROM_USER, true);
    }
    getLoaderManager().restartLoader(0, args, this);
}

From source file:org.chromium.chrome.browser.firstrun.FirstRunActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putAll(mFreProperties);
}

From source file:de.vanita5.twittnuker.fragment.support.BaseSupportListFragment.java

@Override
public Bundle getExtraConfiguration() {
    final Bundle args = getArguments();
    final Bundle extras = new Bundle();
    if (args != null && args.containsKey(EXTRA_EXTRAS)) {
        extras.putAll(args.getBundle(EXTRA_EXTRAS));
    }/*  www . j a  va 2 s . c  o  m*/
    return extras;
}

From source file:org.wahtod.wififixer.ui.MainActivity.java

private void bundleIntent(Intent intent) {
    /*/*ww w  .  j  ava2 s .c  o m*/
     * Dispatch intent commands to handler
    */
    Message message = handler.obtainMessage();
    Bundle data = new Bundle();
    data.putString(PrefUtil.INTENT_ACTION, intent.getAction());
    if (intent.getExtras() != null) {
        data.putAll(intent.getExtras());
    }
    message.setData(data);
    handler.sendMessage(message);
}

From source file:org.mariotaku.twidere.fragment.CursorActivitiesFragment.java

protected void reloadActivities() {
    if (getActivity() == null || isDetached())
        return;/*from   w w  w  . j  a  va 2s  .  c  o m*/
    final Bundle args = new Bundle(), fragmentArgs = getArguments();
    if (fragmentArgs != null) {
        args.putAll(fragmentArgs);
        args.putBoolean(EXTRA_FROM_USER, true);
    }
    getLoaderManager().restartLoader(0, args, this);
}

From source file:de.aw.awlib.fragments.AWFragment.java

/**
 * Uebernimmt Argumente zusaetzlich(!) zu bereits vorhandenen
 *
 * @see Fragment#setArguments(Bundle)/* w w w  . j ava 2  s  . c om*/
 */
public final void setArguments(Bundle args) {
    Bundle oldArgs = getArguments();
    if (oldArgs != null) {
        if (args != null) {
            oldArgs.putAll(args);
        }
    } else {
        super.setArguments(args);
    }
}

From source file:com.myapps.playnation.main.MainActivity.java

private void initGamePage(int childPos) {
    // ToDo Show SelectedGame in a HeaderFragment
    HeaderFragment temp = new HeaderFragment();
    Bundle args = putPositionInBundle(Configurations.GamesSTATE);
    args.putAll(con.getLinker().getItem("'" + mGamesTitles.get(childPos) + "'", Keys.gamesTable));
    // args.putAll();
    temp.setArguments(args);/*w ww .  j av  a2  s .  c  o  m*/
    putOnTop(temp);
}