List of usage examples for android.os Bundle putLong
public void putLong(@Nullable String key, long value)
From source file:com.nadmm.airports.ListMenuFragment.java
@Override protected void onListItemClick(ListView l, View v, int position) { Cursor c = (Cursor) getListAdapter().getItem(position); long id = c.getLong(c.getColumnIndex(BaseColumns._ID)); String title = c.getString(c.getColumnIndex(ListMenuCursor.ITEM_TITLE)); Class<?> clss = getItemFragmentClass(id); if (clss != null) { Bundle args = new Bundle(); args.putString(ActivityBase.FRAGMENT_TAG_EXTRA, String.valueOf(id)); args.putString(SUBTITLE_TEXT, title); args.putLong(MENU_ID, id); getActivityBase().replaceFragment(clss, args); }/*from w w w . j a v a 2 s .com*/ }
From source file:com.facebook.react.modules.datepicker.DatePickerDialogModule.java
private Bundle createFragmentArguments(ReadableMap options) { final Bundle args = new Bundle(); if (options.hasKey(ARG_DATE) && !options.isNull(ARG_DATE)) { args.putLong(ARG_DATE, (long) options.getDouble(ARG_DATE)); }/*from w w w . j a v a 2 s . co m*/ if (options.hasKey(ARG_MINDATE) && !options.isNull(ARG_MINDATE)) { args.putLong(ARG_MINDATE, (long) options.getDouble(ARG_MINDATE)); } if (options.hasKey(ARG_MAXDATE) && !options.isNull(ARG_MAXDATE)) { args.putLong(ARG_MAXDATE, (long) options.getDouble(ARG_MAXDATE)); } return args; }
From source file:ca.ualberta.cmput301w14t08.geochan.fragments.FavouriteCommentsFragment.java
@Override /**// w ww . j a v a 2s. c om * Displays a list view of favourites upon starting the fragment. * */ public void onStart() { super.onStart(); for (ThreadComment tc : list) { Log.e("FAVS", tc.getBodyComment().getId()); } favouritesListView = (ListView) getView().findViewById(R.id.favourites_list); FavouriteCommentsAdapter adapter = new FavouriteCommentsAdapter(list, getActivity()); // Assign custom adapter to the thread listView. favouritesListView.setAdapter(adapter); favouritesListView.setOnItemClickListener(new OnItemClickListener() { @Override /* * On click, launch the fragment responsible for thread viewing */ public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Fragment fragment = new ThreadViewFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("thread", list.get((int) position)); bundle.putInt("favCom", -1); bundle.putLong("id", id); fragment.setArguments(bundle); getFragmentManager().beginTransaction().replace(R.id.container, fragment, "thread_view_fragment") .addToBackStack(null).commit(); // getActivity().getActionBar().setDisplayHomeAsUpEnabled(true); getFragmentManager().executePendingTransactions(); } }); adapter.notifyDataSetChanged(); }
From source file:com.rowland.movies.ui.activities.MainActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(SELECTED_POSITION_KEY, mSelectedPosition); outState.putLong(SELECTED_MOVIE_KEY, mMovieId); }
From source file:com.nextgis.maplibui.formcontrol.DateTime.java
@Override public void saveState(Bundle outState) { outState.putLong(ControlHelper.getSavedStateKey(mFieldName), mCalendar.getTimeInMillis()); if (mTimeDialog != null) mTimeDialog.dismiss();// ww w . jav a2s . co m }
From source file:com.dahl.brendan.wordsearch.model.HighScore.java
public Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putLong(Constants.KEY_HIGH_SCORE_TIME, time); bundle.putInt(Constants.KEY_HIGH_SCORE_SIZE, size); bundle.putString(Constants.KEY_HIGH_SCORE_THEME, theme); bundle.putInt(Constants.KEY_WORD_COUNT, wordCount); bundle.putString(Constants.KEY_HIGH_SCORE_NAME, name); bundle.putInt(Constants.KEY_GLOBAL_RANK, globalRank); bundle.putBoolean(Constants.KEY_GLOBAL_HIGH_SCORE, globalHighScore); bundle.putInt(Constants.KEY_RANK, rank); bundle.putLong(Constants.KEY_HIGH_SCORE, getScore()); return bundle; }
From source file:com.druk.bonjour.browser.ui.fragment.ServiceBrowserFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong(KEY_SELECTED_POSITION, mAdapter.getSelectedItemId()); }
From source file:com.LiteralWord.Bible.Notes.NoteEditFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if (mRowId != null) outState.putLong(ID_TAG, mRowId); outState.putString(TITLE_TAG, mTitleText.getText().toString()); outState.putString(BODY_TAG, mBodyText.getText().toString()); }
From source file:com.bydavy.card.receipts.fragments.ReceiptAddFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putString(STATE_SHOP, mViewShop.getText().toString()); outState.putLong(STATE_DATE, mCalendar.getTimeInMillis()); outState.putString(STATE_NOTE, STATE_NOTE); try {//from ww w. ja v a 2 s.c o m outState.putFloat(STATE_TOTAL, Float.valueOf(mViewTotal.getText().toString())); } catch (final NumberFormatException e) { /* Nothing */ } super.onSaveInstanceState(outState); }
From source file:cl.ipp.katbag.fragment.Add.java
@Override public void onClick(View v) { mainActivity.hideSoftKeyboard();/*from w w w.j ava 2 s. c o m*/ if (id_app == -1) { KatbagUtilities.message(mainActivity.context, getString(R.string.app_empty)); } else { switch (v.getId()) { case R.id.config_app_worlds: mFragment = new Worlds(); break; case R.id.config_app_drawings: mFragment = new Drawings(); break; case R.id.config_app_developments: mFragment = new Develop(); break; case R.id.config_app_pages: mFragment = new Pages(); break; } Bundle bundle = new Bundle(); bundle.putLong("id_app", id_app); bundle.putString("type_app", type_app); mFragment.setArguments(bundle); FragmentTransaction t = getActivity().getSupportFragmentManager().beginTransaction(); t.replace(R.id.fragment_main_container, mFragment); t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); t.addToBackStack(mFragment.getClass().getSimpleName()); t.commit(); } }