Example usage for android.os Bundle putDouble

List of usage examples for android.os Bundle putDouble

Introduction

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

Prototype

public void putDouble(@Nullable String key, double value) 

Source Link

Document

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

Usage

From source file:edu.usf.cutr.opentripplanner.android.fragments.MainFragment.java

public void onSaveInstanceState(Bundle bundle) {
    super.onSaveInstanceState(bundle);

    bundle.putBoolean(OTPApp.BUNDLE_KEY_MAP_FAILED, mMapFailed);

    if (!mMapFailed) {
        bundle.putParcelable(OTPApp.BUNDLE_KEY_MAP_CAMERA, mMap.getCameraPosition());
        bundle.putParcelable(OTPApp.BUNDLE_KEY_MAP_START_MARKER_POSITION, mStartMarkerPosition);
        bundle.putParcelable(OTPApp.BUNDLE_KEY_MAP_END_MARKER_POSITION, mEndMarkerPosition);
        bundle.putBoolean(OTPApp.BUNDLE_KEY_APP_STARTS, mAppStarts);
        bundle.putBoolean(OTPApp.BUNDLE_KEY_IS_START_LOCATION_GEOCODING_PROCESSED,
                mIsStartLocationGeocodingCompleted);
        bundle.putBoolean(OTPApp.BUNDLE_KEY_IS_END_LOCATION_GEOCODING_PROCESSED,
                mIsEndLocationGeocodingCompleted);
        bundle.putBoolean(OTPApp.BUNDLE_KEY_IS_START_LOCATION_CHANGED_BY_USER, mIsStartLocationChangedByUser);
        bundle.putBoolean(OTPApp.BUNDLE_KEY_IS_END_LOCATION_CHANGED_BY_USER, mIsEndLocationChangedByUser);
        Editable tbStarLocationEditable = mTbStartLocation.getText();
        if (tbStarLocationEditable != null) {
            bundle.putString(OTPApp.BUNDLE_KEY_TB_START_LOCATION, tbStarLocationEditable.toString());
        } else {//from   w  w  w . j a v a2s  .  c o  m
            Log.e(OTPApp.TAG, "Not possible to obtain origin while saving app bundle");
        }
        Editable tbEndLocationEditable = mTbEndLocation.getText();
        if (tbEndLocationEditable != null) {
            bundle.putString(OTPApp.BUNDLE_KEY_TB_END_LOCATION, tbEndLocationEditable.toString());
        } else {
            Log.e(OTPApp.TAG, "Not possible to obtain destination while saving app bundle");
        }
        bundle.putString(OTPApp.BUNDLE_KEY_TB_END_LOCATION, mTbEndLocation.getText().toString());
        bundle.putInt(OTPApp.BUNDLE_KEY_DDL_OPTIMIZATION, mDdlOptimization.getCheckedItemPosition());
        bundle.putInt(OTPApp.BUNDLE_KEY_DDL_TRAVEL_MODE, mDdlTravelMode.getCheckedItemPosition());

        bundle.putParcelable(OTPApp.BUNDLE_KEY_SAVED_LAST_LOCATION, mSavedLastLocation);
        bundle.putParcelable(OTPApp.BUNDLE_KEY_SAVED_LAST_LOCATION_CHECKED_FOR_SERVER,
                mSavedLastLocationCheckedForServer);

        if (mResultTripStartLocation != null) {
            bundle.putString(OTPApp.BUNDLE_KEY_RESULT_TRIP_START_LOCATION, mResultTripStartLocation);
        }
        if (mResultTripEndLocation != null) {
            bundle.putString(OTPApp.BUNDLE_KEY_RESULT_TRIP_END_LOCATION, mResultTripEndLocation);
        }

        bundle.putDouble(OTPApp.BUNDLE_KEY_SEEKBAR_MIN_VALUE, mBikeTriangleMinValue);
        bundle.putDouble(OTPApp.BUNDLE_KEY_SEEKBAR_MAX_VALUE, mBikeTriangleMaxValue);

        bundle.putSerializable(OTPApp.BUNDLE_KEY_TRIP_DATE, mTripDate);
        bundle.putBoolean(OTPApp.BUNDLE_KEY_ARRIVE_BY, mArriveBy);

        if (!mFragmentListener.getCurrentItineraryList().isEmpty()) {
            OTPBundle otpBundle = new OTPBundle();
            otpBundle.setFromText(mResultTripStartLocation);
            otpBundle.setToText(mResultTripEndLocation);
            otpBundle.setItineraryList(mFragmentListener.getCurrentItineraryList());
            otpBundle.setCurrentItineraryIndex(mFragmentListener.getCurrentItineraryIndex());
            otpBundle.setCurrentItinerary(mFragmentListener.getCurrentItinerary());
            bundle.putSerializable(OTPApp.BUNDLE_KEY_OTP_BUNDLE, otpBundle);
        }
    }

}