Example usage for android.os Bundle getBundle

List of usage examples for android.os Bundle getBundle

Introduction

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

Prototype

@Nullable
public Bundle getBundle(@Nullable String key) 

Source Link

Document

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.

Usage

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

@Override
public void restoreInstanceState(Bundle savedInstanceState) {
    setSelectedSubreddit(getSelectedSubredditExtra(savedInstanceState));
    this.cursorExtras = savedInstanceState.getBundle(EXTRA_CURSOR_EXTRAS);
}

From source file:com.dwdesign.tweetings.fragment.LocalActivityManagerFragment.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle state = null;//from ww w  .  j  a v  a 2  s .c o  m
    if (savedInstanceState != null) {
        state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
    }

    mLocalActivityManager = new LocalActivityManager(getActivity(), true);
    mLocalActivityManager.dispatchCreate(state);
}

From source file:com.pixplicity.wizardpager.wizard.model.AbstractWizardModel.java

public void load(Bundle savedValues) {
    for (String key : savedValues.keySet()) {
        Page page = mRootPageList.findByKey(key);
        page.resetData(savedValues.getBundle(key));
    }/*from  w  w w  . j  av a2  s. c o m*/
}

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

@Override
public void restoreInstanceState(Bundle savedInstanceState) {
    cursorExtras = savedInstanceState.getBundle(EXTRA_CURSOR_EXTRAS);
}

From source file:com.battlelancer.seriesguide.ui.SearchActivity.java

private void submitSearchQuery(String query) {
    Bundle args = new Bundle();
    args.putString(SearchManager.QUERY, query);

    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        Bundle appData = extras.getBundle(SearchManager.APP_DATA);
        if (appData != null) {
            args.putBundle(SearchManager.APP_DATA, appData);
        }/*from w  ww . j  a v a 2 s . c om*/
    }

    submitSearchQuery(args);
}

From source file:com.cortxt.app.MMC.Activities.FragmentSupport.LocalActivityManagerFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "onCreate(): " + getClass().getSimpleName());

    Bundle state = null;//  w ww . j av  a2 s .  co m
    if (savedInstanceState != null) {
        state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
    }

    mLocalActivityManager = new LocalActivityManager(getActivity(), true);
    mLocalActivityManager.dispatchCreate(state);
}

From source file:com.esminis.server.library.activity.DrawerFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        Bundle bundle = savedInstanceState.getBundle("android:preferences");
        if (bundle != null) {
            try {
                Parcelable parcelable = bundle.getParcelable("modules");
                if (parcelable != null) {
                    Field field = parcelable.getClass().getDeclaredField("dialogBundle");
                    field.setAccessible(true);
                    Bundle bundleTemp = (Bundle) field.get(parcelable);
                    if (bundleTemp != null) {
                        bundleTemp.setClassLoader(getClass().getClassLoader());
                    }//  ww  w.j  av a  2s  .c  o m
                }
            } catch (Throwable ignored) {
            }
        }
    }
    super.onActivityCreated(savedInstanceState);
    if (getView() == null) {
        return;
    }
    View view = getView().findViewById(android.R.id.list);
    if (view == null) {
        return;
    }
    TypedValue attribute = new TypedValue();
    getActivity().getTheme().resolveAttribute(android.R.attr.windowBackground, attribute, true);
    if (attribute.resourceId > 0) {
        view.setBackgroundColor(ContextCompat.getColor(getActivity(), attribute.resourceId));
    }
}

From source file:com.vanisty.maps.LocalActivityManagerFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //        Log.d(TAG, "onCreate(): " + getClass().getSimpleName());

    Bundle state = null;//www  . j  a  v a2s .  c  o  m
    if (savedInstanceState != null) {
        state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
    }

    mLocalActivityManager = new LocalActivityManager(getActivity(), true);
    mLocalActivityManager.dispatchCreate(state);
}

From source file:com.stockbrowser.ComboViewActivity.java

@TargetApi(14)
@Override/*from   w  ww.  jav a2  s  . c om*/
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setResult(RESULT_CANCELED);
    Bundle extras = getIntent().getExtras();
    Bundle args = extras.getBundle(EXTRA_COMBO_ARGS);
    // 
    //        String svStr = extras.getString(EXTRA_INITIAL_VIEW, null);
    String svStr = extras.getString(EXTRA_INITIAL_VIEW);
    UI.ComboViews startingView = svStr != null ? UI.ComboViews.valueOf(svStr) : UI.ComboViews.Bookmarks;
    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.tab_view);
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    if (BrowserActivity.isTablet(this)) {
        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);
        bar.setHomeButtonEnabled(true);
    } else {
        bar.setDisplayOptions(0);
    }

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_bookmarks), BrowserBookmarksPage.class, args);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt(STATE_SELECTED_TAB, 0));
    } else {
        switch (startingView) {
        case Bookmarks:
            mViewPager.setCurrentItem(0);
            break;
        case History:
            mViewPager.setCurrentItem(1);
            break;
        case Snapshots:
            mViewPager.setCurrentItem(2);
            break;
        }
    }
}

From source file:com.android.browser.ComboViewActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setResult(RESULT_CANCELED);//from w w  w  . j  a  v  a 2s  .  c  o  m
    Bundle extras = getIntent().getExtras();
    Bundle args = extras.getBundle(EXTRA_COMBO_ARGS);
    String svStr = extras.getString(EXTRA_INITIAL_VIEW, null);
    ComboViews startingView = svStr != null ? ComboViews.valueOf(svStr) : ComboViews.Bookmarks;
    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.tab_view);
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    if (BrowserActivity.isTablet(this)) {
        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO);
        bar.setHomeButtonEnabled(true);
    } else {
        bar.setDisplayOptions(0);
    }

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_bookmarks), BrowserBookmarksPage.class, args);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_history), BrowserHistoryPage.class, args);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt(STATE_SELECTED_TAB, 0));
    } else {
        switch (startingView) {
        case Bookmarks:
            mViewPager.setCurrentItem(0);
            break;
        case History:
            mViewPager.setCurrentItem(1);
            break;
        case Snapshots:
            mViewPager.setCurrentItem(2);
            break;
        }
    }
}