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.grepsound.activities.MainActivity.java

@Override
public void displayFollowing() {
    mDetailsFragment = new FollowFragment();
    Bundle b = new Bundle();
    b.putSerializable("type", FollowFragment.TYPE.FOLLOWING);
    mDetailsFragment.setArguments(b);//from   www .ja v a  2 s  . c  om
    mDetailsFragment.setOnSlidingFragmentAnimationEnd(this);
    mDetailsFragment.setClickListener(mClickListener);
    switchFragments();
}

From source file:jp.maju.wifiserver.client.ClientActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putSerializable(KEY_SOCKET_INFO, mSocketInfo);
}

From source file:com.grepsound.activities.MainActivity.java

@Override
public void displayFollowers() {
    Log.i(TAG, "displayFollowers");
    mDetailsFragment = new FollowFragment();
    Bundle b = new Bundle();
    b.putSerializable("type", FollowFragment.TYPE.FOLLOWER);
    mDetailsFragment.setArguments(b);/*from ww w . j a v  a 2s .com*/
    mDetailsFragment.setOnSlidingFragmentAnimationEnd(this);
    mDetailsFragment.setClickListener(mClickListener);
    switchFragments();
}

From source file:com.massivcode.androidmusicplayer.activities.MainActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        if (mMusicService != null && mMusicService.getCurrentPlaylist() != null) {
            CurrentPlaylistFragment dialogFragment = new CurrentPlaylistFragment();
            Bundle bundle = new Bundle();
            bundle.putSerializable("data", mMusicService.getCurrentPlaylist());
            bundle.putSerializable("map", mMusicService.getAllMusicData());
            dialogFragment.setArguments(bundle);
            dialogFragment.show(getSupportFragmentManager(), "ManageDbFragment");
        } else {// w  w  w.j  ava  2s. c o  m
            Toast.makeText(MainActivity.this, R.string.notify_no_playing, Toast.LENGTH_SHORT).show();
        }
        return true;
    }

    return super.onOptionsItemSelected(item);
}

From source file:br.com.brolam.cloudvision.ui.NoteVisionDetailsActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(NOTE_VISION_KEY, this.noteVisionKey);
    outState.putSerializable(NOTE_VISION, this.noteVision);
    super.saveCoordinatorLayoutHelper(outState);
    super.saveNestedScrollHelperViewState(outState);
    super.saveRecyclerViewState(outState);

}

From source file:com.cw.litenote.note_add.Note_addCameraVideo.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    System.out.println("Note_addCameraVideo / onSaveInstanceState");
    outState.putSerializable(DB_page.KEY_NOTE_ID, noteId);
}

From source file:de.damdi.fitness.activity.settings.sync.OpenTrainingSyncService.java

protected void onHandleIntent(Intent intent) {
    Log.d(TAG, "onHandleIntent()");

    version = intent.getIntExtra(EXTRA_VERSION_CODE, -1);
    host = intent.getStringExtra(EXTRA_HOST);

    mReceiver = intent.getParcelableExtra("receiver");
    String command = intent.getStringExtra("command");
    Bundle b = new Bundle();
    if (command.equals("query")) {
        try {/* w  ww.  j  a  v  a  2  s.c  o m*/

            // set up REST-Client
            mClient = new RestClient(host, port, "https", version);

            // download and parse the exercises
            ArrayList<ExerciseType> allExercises = downloadAndParseExercises();

            // add data to bundle
            b.putSerializable("all_exercises", allExercises);

            mReceiver.send(STATUS_FINISHED, b);
        } catch (Exception e) {
            Log.e(TAG, "Error, could not get exercises from server: " + e.toString(), e);
            b.putString(Intent.EXTRA_TEXT, e.toString());
            mReceiver.send(STATUS_ERROR, b);
        }
    }
    this.stopSelf();
}

From source file:com.brq.wallet.external.cashila.activity.CashilaNewFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt("spRecipient", spRecipients.getSelectedItemPosition());
    outState.putSerializable("accountLimits", currentAccountLimits);
}

From source file:com.esri.arcgisruntime.sample.stretchrenderer.MainActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    //send parameters to fragment
    ParametersDialogFragment paramDialog = new ParametersDialogFragment();
    Bundle stretchParameters = new Bundle();
    stretchParameters.putInt("min", mMin);
    stretchParameters.putInt("max", mMax);
    stretchParameters.putInt("percent_clip_min", mPercentClipMin);
    stretchParameters.putInt("percent_clip_max", mPercentClipMax);
    stretchParameters.putInt("std_dev_factor", mStdDevFactor);
    stretchParameters.putSerializable("stretch_type", mStretchType);
    paramDialog.setArguments(stretchParameters);
    paramDialog.show(mFragmentManager, "param_dialog");
    return super.onOptionsItemSelected(item);
}

From source file:com.appdynamics.demo.gasp.activity.LocationsActivity.java

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

    // Save incremental search results, page_token and zoom level
    outState.putSerializable(SEARCH_RESULT, mSearchResult);
    outState.putString(PAGE_TOKEN, mPageToken);
    outState.putFloat(ZOOM_LEVEL, mMap.getCameraPosition().zoom);
}