List of usage examples for android.os Bundle putLong
public void putLong(@Nullable String key, long value)
From source file:com.iaraby.template.view.fragment.DetailsFrag.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putInt(Constants.PARAM_SEL_POS_TAG, this.selectedPosition); outState.putInt(Constants.PARAM_CAT_POS_TAG, this.catPosition); outState.putLong(Constants.PARAM_CAT_ID_TAG, this.catId); super.onSaveInstanceState(outState); }
From source file:com.github.jvanhie.discogsscrobbler.SearchActivity.java
/** * Callback method from {@link com.github.jvanhie.discogsscrobbler.ReleaseListFragment.Callbacks} * indicating that the item with the given ID was selected. *///from w ww. j a v a2 s . c o m @Override public void onItemSelected(long id) { mSelected = id; invalidateOptionsMenu(); switch (mPanes) { case 1: //just start new activity with the details Intent detailIntent = new Intent(this, ReleaseDetailActivity.class); detailIntent.putExtra(ReleaseDetailFragment.ARG_ITEM_ID, id); startActivity(detailIntent); break; case 2: //show the pager fragment next to the list mDetailVisible = true; Bundle arguments2 = new Bundle(); arguments2.putLong(ReleasePagerFragment.ARG_ITEM_ID, id); arguments2.putBoolean(ReleasePagerFragment.HAS_MENU, false); mReleasePager = new ReleasePagerFragment(); mReleasePager.setArguments(arguments2); getSupportFragmentManager().beginTransaction().replace(R.id.release_pager_container, mReleasePager) .commit(); findViewById(R.id.release_pager_container).setVisibility(View.VISIBLE); break; case 3: //whoa, screen estate! Show detail view _and_ tracklist mDetailVisible = true; Bundle arguments3 = new Bundle(); arguments3.putLong(ReleasePagerFragment.ARG_ITEM_ID, id); arguments3.putBoolean(ReleasePagerFragment.SHOW_TRACKLIST, false); arguments3.putBoolean(ReleasePagerFragment.HAS_MENU, false); mReleasePager = new ReleasePagerFragment(); mReleasePager.setArguments(arguments3); Bundle arguments3_t = new Bundle(); arguments3_t.putLong(ReleaseDetailFragment.ARG_ITEM_ID, id); mReleaseTracklist = new ReleaseTracklistFragment(); mReleaseTracklist.setArguments(arguments3_t); getSupportFragmentManager().beginTransaction().replace(R.id.release_detail_container, mReleasePager) .replace(R.id.release_tracklist_container, mReleaseTracklist).commit(); findViewById(R.id.release_detail_container).setVisibility(View.VISIBLE); findViewById(R.id.release_tracklist_container).setVisibility(View.VISIBLE); break; } }
From source file:org.dvbviewer.controller.ui.fragments.TimerDetails.java
@Override public void onSaveInstanceState(Bundle arg0) { super.onSaveInstanceState(arg0); arg0.putLong(EXTRA_ID, timer.getId()); arg0.putString(EXTRA_TITLE, timer.getTitle()); arg0.putString(EXTRA_CHANNEL_NAME, timer.getChannelName()); arg0.putLong(EXTRA_CHANNEL_ID, timer.getChannelId()); arg0.putLong(EXTRA_START, timer.getStart().getTime()); arg0.putLong(EXTRA_END, timer.getEnd().getTime()); arg0.putInt(EXTRA_ACTION, timer.getTimerAction()); }
From source file:com.android.calendar.event.CreateEventDialogFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(KEY_DATE_STRING, mDateString); outState.putLong(KEY_DATE_IN_MILLIS, mDateInMillis); }
From source file:ca.ualberta.cmput301w14t08.geochan.activities.MainActivity.java
/** * Handles the selection of specific action bar items according * to which item was selected./*from w ww . ja va 2 s .c o m*/ * @param item the item selected * @return the result */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_settings: Intent intent = new Intent(this.getBaseContext(), PreferencesActivity.class); startActivity(intent); return true; case R.id.action_favourites: getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_container, new FavouritesFragment(), "favouritesFrag") .addToBackStack(null).commit(); // This next line is necessary for JUnit to see fragments getSupportFragmentManager().executePendingTransactions(); return true; case R.id.action_add_thread: PostFragment frag = new PostFragment(); Bundle bundle = new Bundle(); bundle.putLong("id", -1); frag.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, frag, "postFrag") .addToBackStack(null).commit(); // This next line is necessary for JUnit to see fragments getSupportFragmentManager().executePendingTransactions(); return true; case android.R.id.home: if (!returnBackStackImmediate(getSupportFragmentManager())) { getSupportFragmentManager().popBackStack(); } return true; default: return super.onOptionsItemSelected(item); } }
From source file:com.csipsimple.ui.filters.AccountFiltersListFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong(CURRENT_CHOICE, curCheckFilterId); }
From source file:com.android.calendar.SearchActivity.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong(BUNDLE_KEY_RESTORE_TIME, mController.getTime()); outState.putString(BUNDLE_KEY_RESTORE_SEARCH_QUERY, mQuery); }
From source file:com.enadein.carlogbook.core.CarLogbookMediator.java
public void showEditNotifcation(long id) { Bundle params = new Bundle(); params.putInt(BaseActivity.MODE_KEY, BaseActivity.PARAM_EDIT); params.putLong(BaseActivity.ENTITY_ID, id); startActivity(AddUpdateNotificationActivity.class, params); }
From source file:com.example.sergey.currentweather.ui.fragment.MainFragment.java
@Override public void CityListItemClicked(View v, long position) { Intent intent = new Intent(getActivity(), DetailActivity.class); Bundle bundle = new Bundle(); bundle.putLong("position", position); intent.putExtras(bundle);//from w w w . j a v a2 s . co m startActivity(intent); CustomAnimationUtils.fromLeftToRightHide(fab, getContext()); }
From source file:com.example.crudcontent.fragment.EditCityFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(STATE_CITY, city); outState.putLong(STATE_STATE_ID, stateId); outState.putLong(STATE_DATE_VISITED, dateOfVisit.getTime()); outState.putString(STATE_NOTES, notes); }