List of usage examples for android.os Bundle getBundle
@Nullable
public Bundle getBundle(@Nullable String key)
From source file:com.android.xbrowser.ComboViewActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setResult(RESULT_CANCELED);//from w ww . java2 s.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); } 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); mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_snapshots), BrowserSnapshotPage.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.baohume.browser.ComboViewActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setResult(RESULT_CANCELED);//from w ww.j a v a2 s.c om Bundle extras = getIntent().getExtras(); Bundle args = extras.getBundle(EXTRA_COMBO_ARGS); String svStr = extras.getString(EXTRA_INITIAL_VIEW, null); 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); mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_history), BrowserHistoryPage.class, args); mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_snapshots), BrowserSnapshotPage.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:org.peercast.core.Channel.java
public List<Servent> getServents() { if (servents == null) { servents = new ArrayList<Servent>(); Bundle bServent = mBundle.getBundle("servent"); while (bServent != null && !bServent.isEmpty()) { servents.add(new Servent(bServent)); bServent = bServent.getBundle("next"); }//from w w w .j av a2s.co m } return servents; }
From source file:com.amen.browser.ComboViewActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setResult(RESULT_CANCELED);/* w w w. ja v a 2 s .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; } } }
From source file:com.android.stockbrowser.ComboViewActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setResult(RESULT_CANCELED);// w w w . j a v a2s .c om 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); mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_snapshots), BrowserSnapshotPage.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.borqs.browser.ComboViewActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.getWindow().addFlags(Window.FEATURE_ACTION_BAR); setResult(RESULT_CANCELED);/* ww w .j a va2s . co 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); mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_snapshots), BrowserSnapshotPage.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.app.controller.LocalActivityManagerFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (DEBUG)/*from w w w . ja v a 2 s . c o m*/ 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); }
From source file:com.battlelancer.seriesguide.ui.SearchActivity.java
private void handleIntent(Intent intent) { if (intent == null) { return;/* w w w . jav a 2 s. c o m*/ } if (Intent.ACTION_SEARCH.equals(intent.getAction())) { Bundle extras = getIntent().getExtras(); // searching episodes within a show? Bundle appData = extras.getBundle(SearchManager.APP_DATA); if (appData != null) { String showTitle = appData.getString(EpisodeSearchFragment.InitBundle.SHOW_TITLE); if (!TextUtils.isEmpty(showTitle)) { // change title + switch to episodes tab if show restriction was submitted viewPager.setCurrentItem(EPISODES_TAB_INDEX); } } // setting the query automatically triggers a search String query = extras.getString(SearchManager.QUERY); searchBar.setText(query); } else if (Intent.ACTION_VIEW.equals(intent.getAction())) { Uri data = intent.getData(); String id = data.getLastPathSegment(); displayEpisode(id); Utils.trackCustomEvent(this, TAG, "Search action", "View"); finish(); } }
From source file:de.sourcestream.movieDB.controller.GalleryList.java
/** * Called to do initial creation of a fragment. * This is called after onAttach(Activity) and before onCreateView(LayoutInflater, ViewGroup, Bundle). * * @param savedInstanceState If the fragment is being re-created from a previous saved state, this is the state. */// ww w . ja v a 2 s .c o m @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) save = savedInstanceState.getBundle("save"); }
From source file:org.mozilla.gecko.sync.SynchronizerConfigurations.java
public SynchronizerConfigurations(Bundle bundle) throws IOException, ParseException, NonObjectJSONException, UnknownSynchronizerConfigurationVersionException { if (bundle == null) { bundle = new Bundle(); }//from w ww . j a v a 2 s .com Bundle engineBundle = bundle.getBundle("engines"); if (engineBundle == null) { this.initializeDefaultEnginesMap(); return; } int version = engineBundle.getInt("version"); if (version == 0) { // No data in the bundle. this.initializeDefaultEnginesMap(); return; } if (version == 1) { engines = enginesMapFromBundleV1(engineBundle); return; } throw new UnknownSynchronizerConfigurationVersionException(version); }