List of usage examples for android.os Bundle putSerializable
@Override public void putSerializable(@Nullable String key, @Nullable Serializable value)
From source file:com.example.kharlamov.cheesetask.CheeseListFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putSerializable(KEY_CHEESES, mCheeseList); }
From source file:net.reichholf.dreamdroid.fragment.abs.AbstractHttpFragment.java
@Override public Bundle getLoaderBundle(int loader) { Bundle args = new Bundle(); args.putSerializable("params", getHttpParams(DreamDroidHttpFragmentHelper.LOADER_DEFAULT_ID)); return args;/* w w w . j a v a2 s . c o m*/ }
From source file:com.cloudkick.DashboardActivity.java
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Bundle data = new Bundle(); data.putSerializable("node", nodes.get(position)); Intent intent = new Intent(DashboardActivity.this, NodeViewActivity.class); intent.putExtras(data);// ww w. j a va 2 s . c o m startActivity(intent); }
From source file:com.engine.privatefood.activity.ImagePreviewActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image_pre); androidImagePicker = AndroidImagePicker.getInstance(); androidImagePicker.addOnImageSelectedListener(this); mImageList = AndroidImagePicker.getInstance().getImageItemsOfCurrentImageSet(); mShowItemPosition = getIntent().getIntExtra(AndroidImagePicker.KEY_PIC_SELECTED_POSITION, 0); mBtnOk = (TextView) findViewById(R.id.btn_ok); mBtnOk.setOnClickListener(this); mCbSelected = (CheckBox) findViewById(R.id.btn_check); mTitleCount = (TextView) findViewById(R.id.tv_title_count); mTitleCount.setText("1/" + mImageList.size()); int selectedCount = AndroidImagePicker.getInstance().getSelectImageCount(); onImageSelected(0, null, selectedCount, androidImagePicker.getSelectLimit()); //back press/*ww w .j a va 2s . c om*/ findViewById(R.id.btn_backpress).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); mCbSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (androidImagePicker.getSelectImageCount() > androidImagePicker.getSelectLimit()) { if (mCbSelected.isChecked()) { //holder.cbSelected.setCanChecked(false); mCbSelected.toggle(); String toast = getResources().getString(R.string.you_have_a_select_limit, androidImagePicker.getSelectLimit()); Toast.makeText(ImagePreviewActivity.this, toast, Toast.LENGTH_SHORT).show(); } else { // } } else { // } } }); mCbSelected.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { mFragment.selectCurrent(isChecked); } }); mFragment = new ImagePreviewFragment(); Bundle data = new Bundle(); data.putSerializable(AndroidImagePicker.KEY_PIC_PATH, (Serializable) mImageList); data.putInt(AndroidImagePicker.KEY_PIC_SELECTED_POSITION, mShowItemPosition); mFragment.setArguments(data); getSupportFragmentManager().beginTransaction().replace(R.id.container, mFragment).commit(); }
From source file:com.mummyding.app.leisure.support.adapter.ReadingAdapter.java
@Override public void onBindViewHolder(final ViewHolder holder, final int position) { final BookBean bookBean = getItem(position); holder.title.setText(bookBean.getTitle()); holder.info.setText(bookBean.getInfo()); if (Settings.noPicMode && HttpUtil.isWIFI == false) { holder.image.setImageURI(null);/*from w w w.jav a 2 s . c o m*/ } else { holder.image.setImageURI(Uri.parse(bookBean.getImage())); } holder.parentView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mContext, ReadingDetailsActivity.class); Bundle bundle = new Bundle(); bundle.putSerializable(mContext.getString(R.string.id_book), bookBean); intent.putExtras(bundle); mContext.startActivity(intent); } }); // set ebook if (Utils.hasString(bookBean.getEbook_url())) { holder.ebook.setVisibility(View.VISIBLE); } else { holder.ebook.setVisibility(View.GONE); } if (isCollection) { holder.collect_cb.setVisibility(View.GONE); holder.text.setText(R.string.text_remove); holder.text.setTextColor(ContextCompat.getColor(mContext, R.color.colorPrimary)); holder.text.setTextSize(18); holder.text.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Snackbar.make(holder.parentView, R.string.notify_remove_from_collection, Snackbar.LENGTH_SHORT) .setAction(mContext.getString(R.string.text_ok), new View.OnClickListener() { @Override public void onClick(View v) { if (mItems.contains(bookBean) == false) { return; } mCache.execSQL(ReadingTable.updateCollectionFlag(bookBean.getTitle(), 0)); mCache.execSQL(ReadingTable.deleteCollectionFlag(bookBean.getTitle())); mItems.remove(position); notifyDataSetChanged(); } }).show(); } }); return; } holder.collect_cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { bookBean.setIs_collected(isChecked ? 1 : 0); mCache.execSQL(ReadingTable.updateCollectionFlag(bookBean.getTitle(), isChecked ? 1 : 0)); if (isChecked) { mCache.addToCollection(bookBean); } else { mCache.execSQL(ReadingTable.deleteCollectionFlag(bookBean.getTitle())); } } }); holder.collect_cb.setChecked(bookBean.getIs_collected() == 1 ? true : false); }
From source file:com.blogspot.marioboehmer.thingibrowse.fragments.ThingResultListFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putSerializable(THING_RESULT_LIST, thingResultList); outState.putInt(CURRENT_PAGE, currentPage); outState.putInt(LAST_PAGE_INDEX, lastPageIndex); outState.putString(THING_CATEGORY_BASE_URL, thingCategoryBaseUrl); outState.putBoolean(IS_SEARCH, isSearchResultList); outState.putString(SEARCH_TERM, searchTerm); super.onSaveInstanceState(outState); }
From source file:com.example.jony.myapp.reader_APP.adapter.ReadingItemAdapter.java
@Override public void onBindViewHolder(final ViewHolder holder, int position) { final BookBean bookBean = mList.get(position); holder.title.setText(bookBean.getTitle()); holder.info.setText(bookBean.getInfo()); if (Settings.noPicMode && HttpUtil.isWIFI == false) { holder.image.setImageURI(null);/*from w ww. j a v a 2s . c om*/ } else { holder.image.setImageURI(Uri.parse(bookBean.getImage())); } holder.parentView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mContext, ReadingDetailsActivity.class); Bundle bundle = new Bundle(); bundle.putSerializable(mContext.getString(R.string.reader_id_book), bookBean); intent.putExtras(bundle); mContext.startActivity(intent); } }); // set ebook if (Utils.hasString(bookBean.getEbook_url())) { holder.ebook.setVisibility(View.VISIBLE); } else { holder.ebook.setVisibility(View.GONE); } if (isCollection) { holder.collect_cb.setVisibility(View.GONE); holder.text.setText(R.string.reader_text_remove); holder.text.setTextColor(ContextCompat.getColor(mContext, R.color.colorPrimary)); holder.text.setTextSize(18); holder.text.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Snackbar.make(holder.parentView, R.string.reader_notify_remove_from_collection, Snackbar.LENGTH_SHORT) .setAction(mContext.getString(R.string.reader_text_ok), new View.OnClickListener() { @Override public void onClick(View v) { /*if (mItems.contains(bookBean) == false) { return; } mCache.execSQL(ReadingTable.updateCollectionFlag(bookBean.getTitle(), 0)); mCache.execSQL(ReadingTable.deleteCollectionFlag(bookBean.getTitle())); mItems.remove(position); notifyDataSetChanged();*/ } }).show(); } }); return; } holder.collect_cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { /*bookBean.setIs_collected(isChecked ? 1 : 0); mCache.execSQL(ReadingTable.updateCollectionFlag(bookBean.getTitle(), isChecked ? 1 : 0)); if (isChecked) { mCache.addToCollection(bookBean); } else { mCache.execSQL(ReadingTable.deleteCollectionFlag(bookBean.getTitle())); }*/ } }); holder.collect_cb.setChecked(bookBean.getIs_collected() == 1 ? true : false); }
From source file:com.easemob.chatuidemo.activity.AddContactActivity.java
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { User user = list.get(position);/*from w ww . j a v a2s. c o m*/ Intent it = new Intent(); Bundle bundle = new Bundle(); bundle.putSerializable("user", user); it.putExtras(bundle); it.setClass(this, Activity_boshu_AddFriend.class); startActivity(it); }
From source file:com.music.androidtest.activity.MainActivity.java
public void onMusicItemClicked(@NonNull MusicItem item) { Timber.d("Music item clicked: " + item.getTitle() + " clicked"); backtoolbar.setVisibility(View.VISIBLE); if (musicDetailFragment == null) { musicDetailFragment = MusicDetailFragment.newInstance(); }/*from w w w. j a v a 2s . co m*/ if (null == detailsSubscriptions || detailsSubscriptions.isUnsubscribed()) { detailsSubscriptions = new CompositeSubscription(); } detailsSubscriptions.addAll(musicDetailFragment.onArticleBackPressed().subscribe(this::onHackyBack), musicDetailFragment.onMessageToShow().subscribe(this::showMessage)); //TODO: to optimize with parcelable Bundle bundle = new Bundle(); Gson gson = new Gson(); String mapJsonStr = gson.toJson(item); bundle.putSerializable(AppConstants.OBJ_TO_SEND, mapJsonStr); musicDetailFragment.setArguments(bundle); attachFragment(musicDetailFragment, TAG_ADVERT_FRAGMENT_DETAIL); }
From source file:com.blogspot.marioboehmer.thingibrowse.fragments.ThingDetailsFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putSerializable(THING, thing); outState.putString(THING_URL, thingUrl); super.onSaveInstanceState(outState); }