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:ac.robinson.bettertogether.ConnectionSetupActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    if (mCaptureManager != null) {
        mCaptureManager.onSaveInstanceState(outState);
    }/*  www .j av a 2 s .c o  m*/
    outState.putSerializable("mConnectionMode", mConnectionMode);
    super.onSaveInstanceState(outState);
}

From source file:ca.farrelltonsolar.classic.ModbusTask.java

public Bundle getChargeControllerInformation() throws ModbusException {
    Bundle result = new Bundle();
    DeviceType deviceType = lookForTriStar();
    result.putSerializable("DeviceType", deviceType);
    if (deviceType == DeviceType.Classic) {
        result.putString("UnitName", getUnitName());
        result.putInt("UnitID", getUnitID());
        result.putBoolean("FoundWhizbang", lookForWhizBangJr());
    } else {//from  w ww.  ja  v a2 s  . co  m
        result.putString("UnitName", "Tristar");
        result.putInt("UnitID", 0);
    }
    return result;
}

From source file:com.hscardref.android.view.NodeSelectorFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    //NOTE: onSaveInstanceState() is not always called (such as when a user navigates back from activity B to activity A). 
    //       ref:http://forums.xamarin.com/discussion/6103/onsave-restoreinstancestate-by-back-button-pressing-not-called-but-destroyed  @TomOpgenorth
    Util.trace(LogTag.LifeCycleManagement,
            String.format("%s: onSaveInstanceState", getClass().getSimpleName()));
    outState.putSerializable("currentNodeType", _currentNodeType); //enum is serializable
    super.onSaveInstanceState(outState);
}

From source file:de.j4velin.mapsmeasure.Map.java

@Override
protected void onSaveInstanceState(final Bundle outState) {
    outState.putSerializable("trace", trace);
    outState.putBoolean("metric", metric);
    if (mMap != null) { // might be null if there is an issue with Google
        // Play Services
        outState.putDouble("position-lon", mMap.getCameraPosition().target.longitude);
        outState.putDouble("position-lat", mMap.getCameraPosition().target.latitude);
        outState.putFloat("position-zoom", mMap.getCameraPosition().zoom);
    }//from  w ww .  ja  v a 2  s .c  om
    super.onSaveInstanceState(outState);
}

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

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

From source file:cn.finalteam.galleryfinal.PhotoEditActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putSerializable("selectPhotoMap", mSelectPhotoList);
    outState.putSerializable("editPhotoCacheFile", mEditPhotoCacheFile);
    outState.putSerializable("photoTempMap", mPhotoTempMap);

    outState.putInt("selectIndex", mSelectIndex);
    outState.putBoolean("cropState", mCropState);
    outState.putBoolean("rotating", mRotating);

    outState.putBoolean("takePhotoAction", mTakePhotoAction);
    outState.putBoolean("cropPhotoAction", mCropPhotoAction);
    outState.putBoolean("editPhotoAction", mEditPhotoAction);

}

From source file:com.kaliturin.blacklist.fragments.ContactsFragment.java

private void showAddContactsActivity(String permission, ContactSourceType sourceType, @StringRes int titleId) {
    // if permission isn't granted
    if (Permissions.notifyIfNotGranted(getContext(), permission)) {
        return;/*from w  ww  .  ja  v  a  2s. co m*/
    }

    // permission is granted
    Bundle arguments = new Bundle();
    Class<? extends Fragment> fragmentClass;
    if (sourceType != null) {
        // fragment of adding contacts from sms-content / call log
        arguments.putInt(CONTACT_TYPE, contactType);
        arguments.putSerializable(SOURCE_TYPE, sourceType);
        arguments.putBoolean(SINGLE_NUMBER_MODE, true);
        fragmentClass = AddContactsFragment.class;
    } else {
        // fragment of adding contacts manually
        arguments.putInt(CONTACT_TYPE, contactType);
        fragmentClass = AddOrEditContactFragment.class;
    }

    // open activity with contacts adding fragment
    CustomFragmentActivity.show(getActivity(), getString(titleId), fragmentClass, arguments, 0);
}

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

/**
 * @param ref//from w ww.j  a v a2s  .  c om
 *            The ServiceReference to catch the EPG for
 * @param nam
 *            The name of the Service for the reference
 */
public void openEpg(String ref, String nam) {
    ServiceEpgListFragment f = new ServiceEpgListFragment();
    ExtendedHashMap map = new ExtendedHashMap();
    map.put(Event.KEY_SERVICE_REFERENCE, ref);
    map.put(Event.KEY_SERVICE_NAME, nam);
    Bundle args = new Bundle();
    args.putSerializable(sData, map);
    f.setArguments(args);

    getMultiPaneHandler().showDetails(f, true);
}

From source file:com.github.pedrovgs.sample.activity.PlacesSampleActivity.java

/**
 * Keep a reference of the last DraggablePanelState.
 *
 * @param outState Bundle used to store the DraggablePanelState.
 *//*from  w ww  .  j  ava2 s .co  m*/
private void saveDraggableState(Bundle outState) {
    DraggableState draggableState = null;
    if (draggablePanel.isMaximized()) {
        draggableState = DraggableState.MAXIMIZED;
    } else if (draggablePanel.isMinimized()) {
        draggableState = DraggableState.MINIMIZED;
    } else if (draggablePanel.isClosedAtLeft()) {
        draggableState = DraggableState.CLOSED_AT_LEFT;
    } else if (draggablePanel.isClosedAtRight()) {
        draggableState = DraggableState.CLOSED_AT_RIGHT;
    }
    outState.putSerializable(DRAGGABLE_PANEL_STATE, draggableState);
}