Example usage for android.os Bundle putSerializable

List of usage examples for android.os Bundle putSerializable

Introduction

In this page you can find the example usage for android.os Bundle putSerializable.

Prototype

@Override
public void putSerializable(@Nullable String key, @Nullable Serializable value) 

Source Link

Document

Inserts a Serializable value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:org.mifos.androidclient.main.CustomerDetailsActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putSerializable(CustomerDetailsEntity.BUNDLE_KEY, mDetails);
    outState.putSerializable(Fee.BUNDLE_KEY, (Serializable) mApplicableFees);
    TabHost tabs = (TabHost) findViewById(R.id.customerDetails_tabhost);
    if (tabs != null) {
        outState.putSerializable(SELECTED_TAB_BUNDLE_KEY, tabs.getCurrentTab());
    }//w ww . j  av  a  2  s  . c  o  m
}

From source file:org.alfresco.mobile.android.api.session.impl.CloudSessionImpl.java

@Override
public void writeToParcel(Parcel dest, int arg1) {
    dest.writeString(baseUrl);//  w w  w  .jav a  2 s.c o m
    dest.writeString(userIdentifier);
    dest.writeString(password);
    dest.writeSerializable(currentNetwork);
    dest.writeParcelable(rootNode, PARCELABLE_WRITE_RETURN_VALUE);
    dest.writeSerializable(repositoryInfo);
    dest.writeSerializable(cmisSession);
    Bundle b = new Bundle();
    b.putSerializable("userParameters", (Serializable) userParameters);
    dest.writeBundle(b);
}

From source file:com.amazon.alexa.avs.companion.LoginWithAmazonActivity.java

protected void showAlertDialog(Exception exception) {
    exception.printStackTrace();//  w ww  . j  a v a  2  s  .  c  o m
    ErrorDialogFragment dialogFragment = new ErrorDialogFragment();
    Bundle args = new Bundle();
    args.putSerializable(BUNDLE_KEY_EXCEPTION, exception);
    dialogFragment.setArguments(args);
    FragmentManager fm = getSupportFragmentManager();
    dialogFragment.show(fm, "error_dialog");
}

From source file:com.github.yuukis.businessmap.app.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    int navigationIndex = getSupportActionBar().getSelectedNavigationIndex();
    outState.putInt(KEY_NAVIGATION_INDEX, navigationIndex);
    outState.putSerializable(KEY_CONTACTS_LIST, (Serializable) mContactsList);
    super.onSaveInstanceState(outState);
}

From source file:com.fimagena.filepicker.FilePickerFragment.java

@Override
public void onSaveInstanceState(Bundle b) {
    super.onSaveInstanceState(b);
    b.putString(KEY_CURRENT_PATH, getCurrentPath().getPath());
    b.putSerializable(KEY_PARAMS, mParams);
    // TODO: could save and load checked items, so they survive the fragment being destroyed when memory is low
}

From source file:de.elanev.studip.android.app.frontend.forums.ForumEntryFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (isAdded()) {
        switch (item.getItemId()) {
        case android.R.id.home:
            getActivity().onBackPressed();

            return true;
        case R.id.forum_area_add:
            Bundle args = new Bundle();
            args.putString(ForumEntry.ID, mEntryId);
            args.putSerializable(ForumEntryComposeFragment.ENTRY_TYPE,
                    ForumEntryComposeFragment.EntryType.REPLY_ENTRY);

            Intent intent = new Intent(getActivity(), ForumEntryComposeActivity.class);
            intent.putExtras(args);//from w w w .  j  a v a 2s  . c o m
            startActivityForResult(intent, CREATE_ENTRY);

            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }
    return true;
}

From source file:cn.edu.zafu.news.ui.main.NewsFragment.java

private void initRecyclerView(View view) {
    mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    //?/* w w  w  . j av a  2s  . com*/
    mRecyclerView.setHasFixedSize(true);

    //?
    final RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView
            .addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mRecyclerView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (isRefreshing) {
                return true;
            } else {
                return false;
            }
        }
    });
    //???
    mAdapter = new NewsAdapter(list);

    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            int lastVisibleItem = ((LinearLayoutManager) mLayoutManager).findLastVisibleItemPosition();
            int totalItemCount = mLayoutManager.getItemCount();
            if (lastVisibleItem >= totalItemCount - 5 && dy > 0) {
                if (!isLoadingMore) {
                    loadMore();
                }
            }
        }
    });
    mAdapter.setOnItemClickLitener(new NewsAdapter.OnItemClickLitener() {
        @Override
        public void onItemClick(View view, int position) {
            //  Intent intent = new Intent(getActivity(), ContentActivity.class);
            Bundle bundle = new Bundle();
            bundle.putSerializable("news_item", list.get(position));
            //   intent.putExtras(bundle);
            //startActivity(intent);
            openPage("newscontent", bundle, CoreAnim.slide);

        }

        @Override
        public void onItemLongClick(View view, int position) {

        }
    });

}

From source file:com.grayfox.android.app.activity.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt(CURRENT_TITLE_KEY, currentTitleId);
    outState.putSerializable(USER_KEY, user);
    outState.putInt(CURRENT_SELECTED_OPTION_KEY, drawerItemAdapter.getSelectedPosition());
}

From source file:fi.mikuz.boarder.gui.internet.Login.java

private void logout() {
    Bundle bundle = new Bundle();
    bundle.putSerializable(InternetMenu.LOGIN_KEY, null);

    Intent intent = new Intent();
    intent.putExtras(bundle);//from ww  w . j  av a 2  s . co m

    bundle.putString(InternetMenu.ACCOUNT_MESSAGE_KEY, "");
    setResult(RESULT_OK, intent);
    try {
        finish();
    } catch (Throwable e) {
        Log.e(TAG, "Couldn't finish", e);
    }
}

From source file:com.liferay.mobile.screens.base.list.BaseListScreenletView.java

@Override
protected Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();

    A adapter = getAdapter();//  ww  w  .  ja  va  2  s.c o m
    ArrayList<E> entries = (ArrayList<E>) adapter.getEntries();

    Bundle state = new Bundle();
    state.putParcelableArrayList(STATE_ENTRIES, entries);
    state.putSerializable(STATE_ROW_COUNT, adapter.getItemCount());
    state.putParcelable(STATE_SUPER, superState);
    state.putStringArrayList(STATE_LABEL_FIELDS,
            (ArrayList<String>) ((BaseListScreenlet) getScreenlet()).getLabelFields());
    state.putInt(STATE_FIRST_ROW, firstRow);

    return state;
}