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.luseen.spacenavigation.SpaceNavigationView.java

/**
 * Save budges and current position/*from   ww w.  java 2  s.c  o  m*/
 *
 * @param outState bundle to saveInstance
 */
public void onSaveInstanceState(Bundle outState) {
    outState.putInt(CURRENT_SELECTED_ITEM_BUNDLE_KEY, currentSelectedItem);
    outState.putSerializable(BUDGES_ITEM_BUNDLE_KEY, badgeSaveInstanceHashMap);
}

From source file:com.hackensack.umc.activity.ProfileActivity.java

private void startRegistrationActivity(DataForAutoRegistration dataTosend) {
    Intent intent = new Intent(ProfileActivity.this, RegistrationDetailsActivity.class);
    Bundle b = new Bundle();
    b.putSerializable(Constant.REG_REQUIRED_DATA, dataTosend);
    b.putInt(Constant.REGISTRATION_MODE, Constant.AUTO);
    b = putUrlValuesInBundle(b);/*from  w w  w .jav  a2s.c o m*/
    intent.putExtra(Constant.BUNDLE, b);
    startActivity(intent);
}

From source file:com.markupartist.sthlmtraveling.DeparturesActivity.java

private void onData(Departures result) {
    selectPreferredTransport();/*w w  w .  j a  v  a 2s . c  o m*/

    // TODO: Fix this mess.
    Bundle b0 = mPageAdapter.getPageArgs(0);
    b0.putSerializable(DepartureFragment.ARG_DEPARTURES, result);
    mPageAdapter.updatePageArgs(0, b0);

    Bundle b1 = mPageAdapter.getPageArgs(1);
    b1.putSerializable(DepartureFragment.ARG_DEPARTURES, result);
    mPageAdapter.updatePageArgs(1, b1);

    Bundle b2 = mPageAdapter.getPageArgs(2);
    b2.putSerializable(DepartureFragment.ARG_DEPARTURES, result);
    mPageAdapter.updatePageArgs(2, b2);

    Bundle b3 = mPageAdapter.getPageArgs(3);
    b3.putSerializable(DepartureFragment.ARG_DEPARTURES, result);
    mPageAdapter.updatePageArgs(3, b3);

    updateFragment(0, result);
    updateFragment(1, result);
    updateFragment(2, result);
    updateFragment(3, result);
}

From source file:com.tt.jobtracker.MainActivity.java

@Override
public void onTaskLineItemSelected(TaskLineItemViewModel taskLineItemViewModel) {

    taskLineItemDetailFragment = new TaskLineItemDetailFragment();
    if (taskLineItemDetailFragment != null) {
        Bundle args = new Bundle();
        args.putSerializable("TaskLineItem", taskLineItemViewModel);
        taskLineItemDetailFragment.setArguments(args);

        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction().replace(R.id.content_frame, taskLineItemDetailFragment)
                .addToBackStack("taskdetail").commit();
    }/*from w w w .java2  s.  c om*/

}

From source file:co.taqat.call.assistant.AssistantActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.putSerializable("CurrentFragment", currentFragment);
    outState.putBoolean("echoCanceller", echoCancellerAlreadyDone);
    super.onSaveInstanceState(outState);
}

From source file:com.example.rps.RpsFragment.java

@Override
public void onSaveInstanceState(Bundle bundle) {
    super.onSaveInstanceState(bundle);
    bundle.putInt(WIN_KEY, wins);//from w  w  w .ja va 2 s  .  c o m
    bundle.putInt(LOSS_KEY, losses);
    bundle.putInt(TIE_KEY, ties);
    bundle.putInt(COMPUTER_CHOICE_KEY, computerChoice);
    bundle.putInt(PLAYER_CHOICE_KEY, playerChoice);
    bundle.putSerializable(STATE_KEY, currentState);
    bundle.putSerializable(RESULT_KEY, result);
    bundle.putBoolean(PENDING_PUBLISH_KEY, pendingPublish);
    bundle.putBoolean(IMPLICIT_PUBLISH_KEY, shouldImplicitlyPublish);
}

From source file:net.reichholf.dreamdroid.fragment.TimerEditFragment.java

/**
 *
 *///ww  w. j  av a  2 s .  c  o m
private void pickService() {
    ServiceListFragment f = new ServiceListFragment();
    Bundle args = new Bundle();

    ExtendedHashMap data = new ExtendedHashMap();
    data.put(Service.KEY_REFERENCE, "default");

    args.putSerializable(sData, data);
    args.putString("action", Intent.ACTION_PICK);

    f.setArguments(args);
    f.setTargetFragment(this, Statics.REQUEST_PICK_SERVICE);
    ((MultiPaneHandler) getAppCompatActivity()).showDetails(f, true);
}

From source file:com.hackensack.umc.activity.ProfileSelfieManualCropActivity.java

private void startRegistrationActivity(DataForAutoRegistration dataTosend) {
    Intent intent = new Intent(ProfileSelfieManualCropActivity.this, RegistrationDetailsActivity.class);
    Bundle b = new Bundle();
    b.putSerializable(Constant.REG_REQUIRED_DATA, dataTosend);
    b.putInt(Constant.REGISTRATION_MODE, Constant.AUTO);
    b = putUrlValuesInBundle(b);//from  w  w  w . j ava 2s  .  c  om
    intent.putExtra(Constant.BUNDLE, b);
    startActivity(intent);
}

From source file:com.tt.jobtracker.MainActivity.java

public void onTaskSelected(TaskViewModel task) {
    Shared.hideMenu = String.valueOf(task.IsDone);

    if (task.IsMeasurement) {
        //call measurement fragment

        Shared.MeasurementTaskID = task.ID;
        Intent intent = new Intent(MainActivity.this, TakeMeasurementList.class);
        DatabaseHelper dbHelper = new DatabaseHelper(this);
        Shared.SelectedTask = dbHelper.getTaskInfo(String.valueOf(task.ID));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra("TaskID", String.valueOf(task.ID));
        intent.putExtra("ShopID", String.valueOf(task.ShopID));
        intent.putExtra("ShopName", String.valueOf(task.ShopName));
        intent.putExtra("ShopAddress", String.valueOf(task.ShopAddress));
        intent.putExtra("IsDone", String.valueOf(task.IsDone));
        getApplicationContext().startActivity(intent);

        // Intent myIntent = new Intent(MainActivity.this, TakeMeasurement.class);
        //myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        // myIntent.putExtra("PhotoID",taskLineItemViewModel.PhotoID);
        // getApplicationContext().startActivity(myIntent);
        // finish();

    }/*from  w  ww . j  a  v a 2 s . c  o  m*/

    else {
        //call execution fragment

        Fragment fragment = new TaskDetailFragment();
        if (fragment != null) {
            Bundle args = new Bundle();
            args.putSerializable("Task", task);
            fragment.setArguments(args);

            FragmentManager fragmentManager = getSupportFragmentManager();
            fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).addToBackStack("tasklist")
                    .commit();
        }
    }
}

From source file:cn.longchou.wholesale.activity.VehicleDetailActivity.java

private void showBudget() {
     Intent intent = new Intent(this, BudgetConfirmActivity.class);
     Bundle bundle = new Bundle();
     bundle.putSerializable("cars", cars);
     intent.putExtras(bundle);/* ww  w.  j a  va 2 s. c o  m*/
     startActivity(intent);

 }