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:com.github.pockethub.ui.issue.IssueDashboardPagerAdapter.java

@Override
public Fragment getItem(final int position) {
    String filter = null;//from w  w w . ja v  a2  s. co  m
    switch (position) {
    case 0:
        filter = FILTER_SUBSCRIBED;
        break;
    case 1:
        filter = FILTER_ASSIGNED;
        break;
    case 2:
        filter = FILTER_CREATED;
        break;
    case 3:
        filter = FILTER_MENTIONED;
        break;
    default:
        return null;
    }
    final Map<String, String> filterData = new HashMap<>();
    filterData.put(FIELD_FILTER, filter);
    filterData.put(FIELD_SORT, SORT_UPDATED);
    filterData.put(FIELD_DIRECTION, DIRECTION_DESCENDING);
    Bundle bundle = new Bundle();
    bundle.putSerializable(ARG_FILTER, (Serializable) filterData);
    DashboardIssueFragment fragment = new DashboardIssueFragment();
    fragment.setArguments(bundle);
    return fragment;
}

From source file:com.github.mobile.ui.issue.IssueDashboardPagerAdapter.java

@Override
public Fragment getItem(final int position) {
    String filter = null;/*from  w w  w. j av  a  2 s .  c  o  m*/
    switch (position) {
    case 0:
        filter = FILTER_SUBSCRIBED;
        break;
    case 1:
        filter = FILTER_ASSIGNED;
        break;
    case 2:
        filter = FILTER_CREATED;
        break;
    case 3:
        filter = FILTER_MENTIONED;
        break;
    default:
        return null;
    }
    final Map<String, String> filterData = new HashMap<String, String>();
    filterData.put(FIELD_FILTER, filter);
    filterData.put(FIELD_SORT, SORT_UPDATED);
    filterData.put(FIELD_DIRECTION, DIRECTION_DESCENDING);
    Bundle bundle = new Bundle();
    bundle.putSerializable(ARG_FILTER, (Serializable) filterData);
    DashboardIssueFragment fragment = new DashboardIssueFragment();
    fragment.setArguments(bundle);
    return fragment;
}

From source file:com.github.mobile.ui.commit.CommitPagerAdapter.java

@Override
public Fragment getItem(final int item) {
    Bundle arguments = new Bundle();
    arguments.putString(EXTRA_BASE, ids[item].toString());
    arguments.putSerializable(EXTRA_REPOSITORY, repository);
    CommitDiffListFragment fragment = new CommitDiffListFragment();
    fragment.setArguments(arguments);/*from  w  w  w  . j a  va 2  s  .  c  o m*/
    return fragment;
}

From source file:com.github.mobile.ui.issue.IssueSearchActivity.java

@Override
public boolean onCreateOptionsMenu(Menu options) {
    getMenuInflater().inflate(R.menu.search, options);

    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    MenuItem searchItem = options.findItem(R.id.m_search);
    SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

    Bundle args = new Bundle();
    args.putSerializable(EXTRA_REPOSITORY, repository);
    searchView.setAppSearchData(args);//  ww  w. ja v  a  2 s . co m
    return true;
}

From source file:com.commonsware.android.camcon.CameraContentDemoActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putSerializable(EXTRA_FILENAME, output);
}

From source file:com.donal.superne.app.ui.chat.emojicon.EmojiconGridFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putSerializable("emojicons", mData);
}

From source file:com.liferay.social.activity.MainActivity.java

public void showDetails(User user) {
    Fragment fragment = new DetailsFragment();

    Bundle arguments = new Bundle();
    arguments.putSerializable("user", user);
    fragment.setArguments(arguments);/*from  w w  w .j a va  2s .c  o  m*/

    _replaceRightFragment(fragment, DetailsFragment.TAG);
}

From source file:com.bufarini.reminders.collaboration.GMailFeedReader.java

@Override
public void run() {
    try {//from   ww  w . j ava 2s. com
        while (true) {
            String contents = getHttpResponse();
            ArrayList<MailEntry> entries = parseGMailXmlFeed(contents);
            Message message = myHandler.obtainMessage();
            Bundle bundle = new Bundle();
            bundle.putSerializable("emails", entries);
            message.setData(bundle);
            myHandler.sendMessage(message);
            Thread.sleep(FIVE_MINUTES);
        }
    } catch (InterruptedException e) {
        // Nothing to do - exits cleanly from thread
    }
}

From source file:ca.ualberta.cmput301.as1.czervos_notes.AddCounterActivity.java

/**
 * Creates a counter using the name input by the user and bundles the
 * counter to send back to the main activity (CounterListActivity).
 * @param view/*from www  . j  a v  a  2s . c o  m*/
 */
public void createCounter(View view) {
    CounterModel newCounter;
    EditText editText = (EditText) findViewById(R.id.enter_counter_name);
    // Retrieves EditText's text input and converts to a string
    String counterName = editText.getText().toString();
    newCounter = new CounterModel(counterName);
    Intent intent = new Intent(this, CounterListActivity.class);
    Bundle bundle = new Bundle();
    // Bundles newly created counter
    bundle.putSerializable("newCounter", newCounter);
    intent.putExtras(bundle);
    startActivity(intent);
}

From source file:com.grupp32.activity.FlexibleSpaceFragment.java

/**
 * Method sets information to a bundle for passing it onto the fragment (in our case TabFragment)
 *
 * @param scrollY value for current scroll-axis
 * @param summoner Summoner-object passed
 * @param patchVersion patch version passed
 *///from w w w  .j a  va2  s. c o m
public void setArguments(int scrollY, Summoner summoner, String patchVersion) {
    if (0 <= scrollY) {
        // Set information to bundle and set it as arguments
        Bundle args = new Bundle();
        args.putInt(ARG_SCROLL_Y, scrollY);
        args.putSerializable(ARG_SUMMONER, summoner);
        args.putString(ARG_VERSION, patchVersion);
        setArguments(args);
    }
}