List of usage examples for android.os Bundle putLong
public void putLong(@Nullable String key, long value)
From source file:com.app_software.chromisstock.ProductListActivity.java
/** * Callback method from {@link ProductListFragment.Callbacks} * indicating that the item with the given ID was selected. *///www .j a va 2 s . co m @Override public void onItemSelected(Long id) { if (mTwoPane) { // In two-pane mode, show the detail view in this activity by // adding or replacing the detail fragment using a // fragment transaction. Bundle arguments = new Bundle(); arguments.putLong(ProductDetailFragment.ARG_ITEM_ID, id); ProductDetailFragment fragment = new ProductDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().replace(R.id.product_detail_container, fragment) .commit(); } else { // In single-pane mode, simply start the detail activity // for the selected item ID. Intent detailIntent = new Intent(this, ProductDetailActivity.class); detailIntent.putExtra(ProductDetailFragment.ARG_ITEM_ID, id); startActivity(detailIntent); } }
From source file:com.adithya321.sharesanalysis.activities.MainActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { if (drawer != null) outState.putLong("drawerSelection", drawer.getCurrentSelection()); super.onSaveInstanceState(outState); }
From source file:com.enadein.carlogbook.core.CarLogbookMediator.java
public void showModifyLog(int type, long id) { Bundle params = new Bundle(); params.putLong(BaseActivity.ENTITY_ID, id); params.putInt(BaseActivity.MODE_KEY, AddUpdateFuelLogActivity.PARAM_EDIT); Class clazz = (type == ProviderDescriptor.Log.Type.OTHER) ? AddUpdateLogActivity.class : AddUpdateFuelLogActivity.class; startActivity(clazz, params);/*from w w w . j a v a 2s. c o m*/ }
From source file:com.github.kanata3249.ffxieq.android.AtmaSelector.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong("Current", mCurrent); outState.putInt("Index", mIndex); outState.putLong("Filter", mFilterID); }
From source file:cn.studyjams.s2.sj0132.bowenyan.mygirlfriend.nononsenseapps.notepad.ui.list.ActivityList.java
@Override public void onSaveInstanceState(Bundle outState) { if (outState == null) { outState = new Bundle(); }/* w w w.j ava2s . c o m*/ outState.putLong(START_LIST_ID, mCurrentList); super.onSaveInstanceState(outState); }
From source file:com.ericfabreu.wearflashcards.adapters.StudySetAdapter.java
/** * Sends term and definition to CardViewFragment and creates a new card. *///from w ww . j a v a 2 s . co m private CardViewFragment newCard(String term, String definition, boolean star, long id, int position) { Bundle bundle = new Bundle(); bundle.putString(Constants.TAG_TABLE_NAME, mTableName); bundle.putString(Constants.TAG_TERM, term); bundle.putString(Constants.TAG_DEFINITION, definition); bundle.putBoolean(Constants.TAG_STAR, star); bundle.putLong(Constants.TAG_ID, id); CardViewFragment card = new CardViewFragment(); card.setArguments(bundle); card.setPosition(position); card.setAdapter(this); return card; }
From source file:com.github.kanata3249.ffxieq.android.VWAtmaLevelSelectorActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong("Current", mCurrent); outState.putLong("SubId", mSubId); outState.putLong("Filter", mFilterID); }
From source file:com.github.jvanhie.discogsscrobbler.ReleaseListActivity.java
/** * Callback method from {@link ReleaseListFragment.Callbacks} * indicating that the item with the given ID was selected. *//*from w w w. j a v a 2 s .c o m*/ @Override public void onItemSelected(long id) { mSelected = id; 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); detailIntent.putExtra(ReleasePagerFragment.SHOW_VERSIONS, false); startActivity(detailIntent); break; case 2: //show the pager fragment next to the list invalidateOptionsMenu(); Bundle arguments2 = new Bundle(); arguments2.putLong(ReleaseDetailFragment.ARG_ITEM_ID, id); arguments2.putBoolean(ReleasePagerFragment.SHOW_VERSIONS, false); 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 invalidateOptionsMenu(); Bundle arguments3 = new Bundle(); arguments3.putLong(ReleaseDetailFragment.ARG_ITEM_ID, id); mReleaseDetail = new ReleaseDetailFragment(); mReleaseDetail.setArguments(arguments3); Bundle arguments3_t = new Bundle(); arguments3_t.putLong(ReleaseTracklistFragment.ARG_ITEM_ID, id); mReleaseTracklist = new ReleaseTracklistFragment(); mReleaseTracklist.setArguments(arguments3_t); getSupportFragmentManager().beginTransaction().replace(R.id.release_detail_container, mReleaseDetail) .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:com.dabay6.android.apps.carlog.ui.base.fragments.BaseDetailFragment.java
/** * {@inheritDoc}//from w w w . j a v a2 s .com */ @Override public void onSaveInstanceState(final Bundle outState) { super.onSaveInstanceState(outState); if (entityId != null) { outState.putLong(KEY_ENTITY_ID, entityId); } }
From source file:com.dwdesign.tweetings.fragment.BaseUserListsListFragment.java
private void openUserListDetails(final Activity activity, final long account_id, final int list_id, final long user_id, final String screen_name, final String list_name) { if (activity == null) return;//from w ww . java 2 s. c o m if (activity instanceof HomeActivity && ((HomeActivity) activity).isDualPaneMode()) { final HomeActivity home_activity = (HomeActivity) activity; if (mDetailFragment instanceof UserProfileFragment && mDetailFragment.isAdded()) { ((UserProfileFragment) mDetailFragment).getUserInfo(mAccountId, user_id, screen_name); } else { mDetailFragment = new UserListDetailsFragment(); final Bundle args = new Bundle(); args.putLong(INTENT_KEY_ACCOUNT_ID, account_id); args.putInt(INTENT_KEY_LIST_ID, list_id); args.putLong(INTENT_KEY_USER_ID, user_id); args.putString(INTENT_KEY_SCREEN_NAME, screen_name); args.putString(INTENT_KEY_LIST_NAME, list_name); mDetailFragment.setArguments(args); home_activity.showAtPane(HomeActivity.PANE_RIGHT, mDetailFragment, true); } } else { final Uri.Builder builder = new Uri.Builder(); builder.scheme(SCHEME_TWEETINGS); builder.authority(AUTHORITY_LIST_DETAILS); builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id)); if (list_id > 0) { builder.appendQueryParameter(QUERY_PARAM_LIST_ID, String.valueOf(list_id)); } if (user_id > 0) { builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id)); } if (screen_name != null) { builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name); } if (list_name != null) { builder.appendQueryParameter(QUERY_PARAM_LIST_NAME, list_name); } activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build())); } }