Example usage for android.os Bundle getDouble

List of usage examples for android.os Bundle getDouble

Introduction

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

Prototype

public double getDouble(String key) 

Source Link

Document

Returns the value associated with the given key, or 0.0 if no mapping of the desired type exists for the given key.

Usage

From source file:cn.edu.zafu.corepage.base.BaseActivity.java

/**
 * ???//from ww w .j  a v a  2 s. c  o  m
 *
 * @param savedInstanceState Bundle
 */
private void loadActivitySavedData(Bundle savedInstanceState) {
    Field[] fields = this.getClass().getDeclaredFields();
    Field.setAccessible(fields, true);
    Annotation[] ans;
    for (Field f : fields) {
        ans = f.getDeclaredAnnotations();
        for (Annotation an : ans) {
            if (an instanceof SaveWithActivity) {
                try {
                    String fieldName = f.getName();
                    @SuppressWarnings("rawtypes")
                    Class cls = f.getType();
                    if (cls == int.class || cls == Integer.class) {
                        f.setInt(this, savedInstanceState.getInt(fieldName));
                    } else if (String.class.isAssignableFrom(cls)) {
                        f.set(this, savedInstanceState.getString(fieldName));
                    } else if (Serializable.class.isAssignableFrom(cls)) {
                        f.set(this, savedInstanceState.getSerializable(fieldName));
                    } else if (cls == long.class || cls == Long.class) {
                        f.setLong(this, savedInstanceState.getLong(fieldName));
                    } else if (cls == short.class || cls == Short.class) {
                        f.setShort(this, savedInstanceState.getShort(fieldName));
                    } else if (cls == boolean.class || cls == Boolean.class) {
                        f.setBoolean(this, savedInstanceState.getBoolean(fieldName));
                    } else if (cls == byte.class || cls == Byte.class) {
                        f.setByte(this, savedInstanceState.getByte(fieldName));
                    } else if (cls == char.class || cls == Character.class) {
                        f.setChar(this, savedInstanceState.getChar(fieldName));
                    } else if (CharSequence.class.isAssignableFrom(cls)) {
                        f.set(this, savedInstanceState.getCharSequence(fieldName));
                    } else if (cls == float.class || cls == Float.class) {
                        f.setFloat(this, savedInstanceState.getFloat(fieldName));
                    } else if (cls == double.class || cls == Double.class) {
                        f.setDouble(this, savedInstanceState.getDouble(fieldName));
                    } else if (String[].class.isAssignableFrom(cls)) {
                        f.set(this, savedInstanceState.getStringArray(fieldName));
                    } else if (Parcelable.class.isAssignableFrom(cls)) {
                        f.set(this, savedInstanceState.getParcelable(fieldName));
                    } else if (Bundle.class.isAssignableFrom(cls)) {
                        f.set(this, savedInstanceState.getBundle(fieldName));
                    }
                } catch (IllegalArgumentException e) {
                    e.printStackTrace();
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

From source file:org.mozilla.mozstumbler.client.mapview.MapFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    mRootView = inflater.inflate(R.layout.activity_map, container, false);

    AbstractMapOverlay.setDisplayBasedMinimumZoomLevel(getApplication());

    showMapNotAvailableMessage(NoMapAvailableMessage.eHideNoMapMessage);

    final ImageButton centerMe = (ImageButton) mRootView.findViewById(R.id.my_location_button);
    centerMe.setVisibility(View.INVISIBLE);
    centerMe.setOnClickListener(new View.OnClickListener() {
        @Override/*  w w w.  jav  a 2  s.  co  m*/
        public void onClick(View v) {
            if (mAccuracyOverlay == null || mAccuracyOverlay.getLocation() == null)
                return;
            mMap.getController().animateTo((mAccuracyOverlay.getLocation()));
            mUserPanning = false;
        }
    });

    centerMe.setOnTouchListener(new View.OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_DOWN) {
                centerMe.setBackgroundResource(R.drawable.ic_mylocation_click_android_assets);

            } else if (event.getAction() == MotionEvent.ACTION_UP) {
                v.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        centerMe.setBackgroundResource(R.drawable.ic_mylocation_android_assets);
                    }
                }, 200);
            }
            return false;
        }
    });

    mTextViewIsLowResMap = (TextView) mRootView.findViewById(R.id.low_resolution_map_message);
    mTextViewIsLowResMap.setVisibility(View.GONE);

    mMap = (MapView) mRootView.findViewById(R.id.map);
    mMap.setBuiltInZoomControls(true);
    mMap.setMultiTouchControls(true);

    listenForPanning(mMap);

    sGPSColor = getResources().getColor(R.color.gps_track);

    mFirstLocationFix = true;
    int zoomLevel = DEFAULT_ZOOM;
    GeoPoint lastLoc = null;
    if (savedInstanceState != null) {
        mFirstLocationFix = false;
        zoomLevel = savedInstanceState.getInt(ZOOM_KEY, DEFAULT_ZOOM);
        if (savedInstanceState.containsKey(LAT_KEY) && savedInstanceState.containsKey(LON_KEY)) {
            final double latitude = savedInstanceState.getDouble(LAT_KEY);
            final double longitude = savedInstanceState.getDouble(LON_KEY);
            lastLoc = new GeoPoint(latitude, longitude);
        }
    } else {
        lastLoc = ClientPrefs.getInstance().getLastMapCenter();
        if (lastLoc != null) {
            zoomLevel = DEFAULT_ZOOM_AFTER_FIX;
        }
    }

    final GeoPoint loc = lastLoc;
    final int zoom = zoomLevel;
    mMap.getController().setZoom(zoom);
    mMap.getController().setCenter(loc);
    mMap.setMinZoomLevel(AbstractMapOverlay.getDisplaySizeBasedMinZoomLevel());

    mMap.postDelayed(new Runnable() {
        @Override
        public void run() {
            // https://github.com/osmdroid/osmdroid/issues/22
            // These need a fully constructed map, which on first load seems to take a while.
            // Post with no delay does not work for me, adding an arbitrary
            // delay of 300 ms should be plenty.
            Log.d(LOG_TAG, "ZOOM " + zoom);
            mMap.getController().setZoom(zoom);
            mMap.getController().setCenter(loc);
        }
    }, 300);

    Log.d(LOG_TAG, "onCreate");

    mAccuracyOverlay = new AccuracyCircleOverlay(mRootView.getContext(), sGPSColor);
    mMap.getOverlays().add(mAccuracyOverlay);

    mObservationPointsOverlay = new ObservationPointsOverlay(mRootView.getContext());
    mMap.getOverlays().add(mObservationPointsOverlay);

    ObservedLocationsReceiver observer = ObservedLocationsReceiver.getInstance();
    observer.setMapActivity(this);

    initTextView(R.id.text_cells_visible, "000");
    initTextView(R.id.text_wifis_visible, "000");
    initTextView(R.id.text_observation_count, "00000");

    showCopyright();

    mMap.setMapListener(new DelayedMapListener(new MapListener() {
        @Override
        public boolean onZoom(final ZoomEvent e) {
            // This is key to no-wifi (low-res) tile functions, that
            // when the zoom level changes, we check to see if the
            // low-zoom or high-zoom should be shown
            int z = e.getZoomLevel();
            updateOverlayBaseLayer(z);
            updateOverlayCoverageLayer(z);
            mObservationPointsOverlay.zoomChanged(mMap);
            return true;
        }

        @Override
        public boolean onScroll(final ScrollEvent e) {
            return true;
        }
    }, 0));

    return mRootView;
}

From source file:org.opendatakit.common.android.utilities.AndroidUtils.java

public static JSONObject convertFromBundle(String appName, Bundle b) throws JSONException {
    JSONObject jo = new JSONObject();
    Set<String> keys = b.keySet();
    for (String key : keys) {
        Object o = b.get(key);/*  w  w  w . j  a  va2s  . c  o m*/
        if (o == null) {
            jo.put(key, JSONObject.NULL);
        } else if (o.getClass().isArray()) {
            JSONArray ja = new JSONArray();
            Class<?> t = o.getClass().getComponentType();
            if (t.equals(long.class)) {
                long[] a = (long[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put(a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(int.class)) {
                int[] a = (int[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put(a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(double.class)) {
                double[] a = (double[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put(a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(boolean.class)) {
                boolean[] a = (boolean[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put(a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(Long.class)) {
                Long[] a = (Long[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put((a[i] == null) ? JSONObject.NULL : a[i]);
                }
            } else if (t.equals(Integer.class)) {
                Integer[] a = (Integer[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put((a[i] == null) ? JSONObject.NULL : a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(Double.class)) {
                Double[] a = (Double[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put((a[i] == null) ? JSONObject.NULL : a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(Boolean.class)) {
                Boolean[] a = (Boolean[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put((a[i] == null) ? JSONObject.NULL : a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(String.class)) {
                String[] a = (String[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put((a[i] == null) ? JSONObject.NULL : a[i]);
                }
                jo.put(key, ja);
            } else if (t.equals(Bundle.class) || Bundle.class.isAssignableFrom(t)) {
                Bundle[] a = (Bundle[]) o;
                for (int i = 0; i < a.length; ++i) {
                    ja.put((a[i] == null) ? JSONObject.NULL : convertFromBundle(appName, a[i]));
                }
                jo.put(key, ja);
            } else if (t.equals(byte.class)) {
                WebLogger.getLogger(appName).w(tag, "byte array returned -- ignoring");
            } else {
                throw new JSONException("unrecognized class");
            }
        } else if (o instanceof Bundle) {
            jo.put(key, convertFromBundle(appName, (Bundle) o));
        } else if (o instanceof String) {
            jo.put(key, b.getString(key));
        } else if (o instanceof Boolean) {
            jo.put(key, b.getBoolean(key));
        } else if (o instanceof Integer) {
            jo.put(key, b.getInt(key));
        } else if (o instanceof Long) {
            jo.put(key, b.getLong(key));
        } else if (o instanceof Double) {
            jo.put(key, b.getDouble(key));
        }
    }
    return jo;
}

From source file:com.saulcintero.moveon.fragments.Main.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    act = getActivity();/*  w  w  w  . j ava  2 s . c om*/
    mContext = act.getApplicationContext();
    res = mContext.getResources();

    prefs = PreferenceManager.getDefaultSharedPreferences(mContext);

    mDistance = mContext.getString(R.string.zero_with_two_decimal_places_value);
    launchPractice = false;
    paintedPath = new ArrayList<GeoPoint>();
    centerPoint = null;

    if (savedInstanceState != null) {
        chronoBaseValue = savedInstanceState.getLong("chronoBase");
        stopStatus = savedInstanceState.getInt("stopStatus");
        pauseOrResumeStatus = savedInstanceState.getInt("pauseOrResumeStatus");
        activity = savedInstanceState.getInt("activity");
        ACTIVITY_CAMERA = savedInstanceState.getInt("activityCamera");
        pictureCounter = savedInstanceState.getInt("pictureCounter");
        zoom = savedInstanceState.getInt("zoom");
        gpsStatus = savedInstanceState.getString("gpsStatus");
        gpsAccuracy = savedInstanceState.getString("gpsAccuracy");
        mDistance = savedInstanceState.getString("distance");
        mSpeed = savedInstanceState.getString("speed");
        mMaxSpeed = savedInstanceState.getString("maxSpeed");
        mLatitude = savedInstanceState.getString("latitude");
        mLongitude = savedInstanceState.getString("longitude");
        mAltitude = savedInstanceState.getString("altitude");
        mSteps = savedInstanceState.getString("steps");
        mHeartRate = savedInstanceState.getString("hr");
        mCadence = savedInstanceState.getString("cadence");
        path = savedInstanceState.getString("path");
        file = savedInstanceState.getString("file");
        pathOverlayChangeColor = savedInstanceState.getBoolean("pathOverlayChangeColor");
        launchPractice = savedInstanceState.getBoolean("launchPractice");
        isExpanded = savedInstanceState.getBoolean("isExpanded");
        followLocation = savedInstanceState.getBoolean("followLocation");
        hasBeenResumed = savedInstanceState.getBoolean("hasBeenResumed");
        isMetric = savedInstanceState.getBoolean("isMetric");
        latCenterPoint = savedInstanceState.getDouble("latCenterPoint");
        lonCenterPoint = savedInstanceState.getDouble("lonCenterPoint");

        centerPoint = new GeoPoint(latCenterPoint, lonCenterPoint);
    }
}

From source file:org.cm.podd.report.activity.ReportActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(this);
    broadcastManager.registerReceiver(mAlertReceiver, new IntentFilter(FollowAlertService.TAG));

    broadcastManager.registerReceiver(new BroadcastReceiver() {
        @Override//from   w w  w .ja v a2  s .c o  m
        public void onReceive(Context context, Intent intent) {
            long administrationAreaId = intent.getLongExtra("administrationAreaId", -99);
            setRegionId(administrationAreaId);
        }
    }, new IntentFilter(SyncAdministrationAreaService.TAG));

    sharedPrefUtil = new SharedPrefUtil(this);

    setContentView(R.layout.activity_report);

    Toolbar myToolbar = findViewById(R.id.report_toolbar);
    setSupportActionBar(myToolbar);

    long areaId = sharedPrefUtil.getDefaultAdministrationAreaId();
    if (areaId != -99) {
        setRegionId(areaId);
    }

    formView = findViewById(R.id.form);
    locationView = findViewById(R.id.location);

    textProgressLocationView = findViewById(R.id.progress_location_text);
    textProgressLocationView.setTypeface(StyleUtil.getDefaultTypeface(getAssets(), Typeface.NORMAL));
    countdownTextView = findViewById(R.id.countdownTextView);
    countdownTextView.setTypeface(StyleUtil.getDefaultTypeface(getAssets(), Typeface.NORMAL));
    refreshLocationButton = findViewById(R.id.refresh_location_button);
    refreshLocationButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            requestGPSLocation();
            startLocationSearchTimeoutCountdown();
        }
    });
    progressBar = findViewById(R.id.progressBar);

    prevBtn = findViewById(R.id.prevBtn);
    nextBtn = findViewById(R.id.nextBtn);
    nextBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            nextScreen();
        }
    });
    nextBtn.setTypeface(StyleUtil.getDefaultTypeface(getAssets(), Typeface.NORMAL));
    prevBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            onBackPressed();
        }
    });
    prevBtn.setTypeface(StyleUtil.getDefaultTypeface(getAssets(), Typeface.NORMAL));

    disableMaskView = findViewById(R.id.disableMask);

    reportDataSource = new ReportDataSource(this);
    reportTypeDataSource = new ReportTypeDataSource(this);
    reportQueueDataSource = new ReportQueueDataSource(this);

    recordSpecDataSource = RecordSpecDataSource.Companion.getInstance(this);
    followAlertDataSource = new FollowAlertDataSource(this);

    if (savedInstanceState != null) {
        currentFragment = savedInstanceState.getString("currentFragment");
        reportId = savedInstanceState.getLong("reportId");
        reportType = savedInstanceState.getLong("reportType");
        follow = savedInstanceState.getBoolean("follow");
        testReport = savedInstanceState.getBoolean("testReport");
        formIterator = (FormIterator) savedInstanceState.getSerializable("formIterator");
        if (formIterator != null) {
            trigger = formIterator.getForm().getTrigger();
        }
        reportSubmit = savedInstanceState.getInt("reportSubmit");
        followActionName = savedInstanceState.getString("followActionName");
        Log.d(TAG, "onCreate from savedInstance, testFlag = " + testReport);

        currentLatitude = savedInstanceState.getDouble("currentLatitude");
        currentLongitude = savedInstanceState.getDouble("currentLongitude");
        recordSpec = (RecordSpec) savedInstanceState.get("recordSpec");
        parentReportGuid = savedInstanceState.getString("parentReportGuid");
    } else {
        Intent intent = getIntent();
        String action = intent.getAction();
        int startPageId = -1;
        switch (action) {
        case ACTION_NEW_REPORT:
            reportType = intent.getLongExtra("reportType", 0);
            testReport = intent.getBooleanExtra("test", false);
            reportId = reportDataSource.createDraftReport(reportType, testReport);
            follow = false;
            break;
        case FollowAlertService.ORG_CM_PODD_REPORT_FOLLOW:
            reportType = intent.getLongExtra("reportType", 0);
            testReport = false;
            reportId = intent.getLongExtra("reportId", -99);
            follow = intent.getBooleanExtra("follow", false);
            break;
        case ACTION_FOR_EDIT_OR_VIEW:
            reportType = intent.getLongExtra("reportType", 0);
            testReport = intent.getBooleanExtra("test", false);
            reportId = intent.getLongExtra("reportId", -99);
            break;
        case ACTION_CREATE_FOLLOW_REPORT:
            reportType = intent.getLongExtra("reportType", 0);
            parentReportId = intent.getLongExtra("reportId", -99);
            reportId = reportDataSource.createFollowReport(parentReportId);
            follow = true;
            followActionName = "follow";
            break;
        case ACTION_CREATE_FOLLOW_REPORT_WITH_ACTION:
            reportType = intent.getLongExtra("reportType", 0);
            parentReportId = intent.getLongExtra("reportId", -99);
            reportId = reportDataSource.createFollowReport(parentReportId);
            follow = true;
            followActionName = intent.getStringExtra("followActionName");
            startPageId = intent.getIntExtra("startPageId", -1);
            break;
        case ACTION_CREATE_FOLLOW_REPORT_FROM_RECORD:
            reportType = intent.getLongExtra("reportType", 0);
            parentReportGuid = intent.getStringExtra("parentReportGuid");
            String preloadFormData = intent.getStringExtra("preloadFormData");
            reportId = reportDataSource.createFollowReport(reportType, parentReportGuid, preloadFormData);
            follow = true;
            break;

        }

        Form form = reportTypeDataSource.getForm(reportType);
        trigger = form.getTrigger();
        if (trigger != null) {
            Log.d(TAG, String.format(
                    "This report type contain a trigger with pattern:%s, pageId:%d, notificationText:%s",
                    trigger.getPattern(), trigger.getPageId(), trigger.getNotificationText()));
        }
        if (intent.getAction() != null
                && intent.getAction().equals(FollowAlertService.ORG_CM_PODD_REPORT_FOLLOW)) {
            form.setStartWithTrigger(true);
        }

        if (startPageId != -1) {
            form.setStartPageId(startPageId);
        }

        formIterator = new FormIterator(form);
        Report report = loadFormData(form);
        recordSpec = recordSpecDataSource.getByReportTypeId(report.getType());

        nextScreen();
    }

    if (recordSpec != null) {
        final FirebaseContext firebaseContext = FirebaseContext.Companion
                .getInstance(PreferenceContext.Companion.getInstance(getApplicationContext()));
        firebaseContext.auth(this, new Function1<Boolean, Unit>() {
            @Override
            public Unit invoke(Boolean success) {
                if (success) {
                    recordDataSource = firebaseContext.recordDataSource(recordSpec, parentReportGuid);
                }
                return null;
            }
        });
    }

    // open location service only when
    // 1. Create a New report
    // 2. Edit a draft report which don't have any location attach.
    if ((reportSubmit == 0) && (currentLatitude == 0.00)) {
        buildGoogleApiClient();
        if (formIterator.getForm().isForceLocation()) {
            switchToProgressLocationMode();
        }
    }

    /* check softkeyboard visibility */
    final View rootView = getWindow().getDecorView().findViewById(android.R.id.content);
    rootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            // different devices' screens have normal height diff differently
            // eg, roughly 5.5" xxhdpi has 220px, 4.5" xhdpi has 110px, 4", 3.5" hdpi has 75px
            int heightDiff = rootView.getRootView().getHeight() - rootView.getHeight();
            int limitHeightPx = (int) (getResources().getDisplayMetrics().density * 100);
            Log.d(TAG, String.format("diff height=%d, limit height=%d", heightDiff, limitHeightPx));
        }
    });

    Tracker tracker = ((PoddApplication) getApplication()).getTracker(PoddApplication.TrackerName.APP_TRACKER);
    tracker.setScreenName("Report-" + reportType);
    tracker.send(new HitBuilders.AppViewBuilder().build());

    startTime = System.currentTimeMillis();
}

From source file:com.skytree.epubtest.BookViewActivity.java

public void makeLayout() {
    // make fonts
    this.makeFonts();
    // clear the existing themes. 
    themes.clear();//from  ww w . j  a v a 2  s  .  co  m
    // add themes 
    // String name,int foregroundColor,int backgroundColor,int controlColor,int controlHighlightColor,int seekBarColor,int seekThumbColor,int selectorColor,int selectionColor,String portraitName,String landscapeName,String doublePagedName,int bookmarkId
    themes.add(new Theme("white", Color.BLACK, 0xffffffff, Color.argb(240, 94, 61, 35), Color.LTGRAY,
            Color.argb(240, 94, 61, 35), Color.argb(120, 160, 124, 95), Color.DKGRAY, 0x22222222,
            "Phone-Portrait-White.png", "Phone-Landscape-White.png", "Phone-Landscape-Double-White.png",
            R.drawable.bookmark2x));
    themes.add(new Theme("brown", Color.BLACK, 0xffece3c7, Color.argb(240, 94, 61, 35),
            Color.argb(255, 255, 255, 255), Color.argb(240, 94, 61, 35), Color.argb(120, 160, 124, 95),
            Color.DKGRAY, 0x22222222, "Phone-Portrait-Brown.png", "Phone-Landscape-Brown.png",
            "Phone-Landscape-Double-Brown.png", R.drawable.bookmark2x));
    themes.add(new Theme("black", Color.LTGRAY, 0xff323230, Color.LTGRAY, Color.LTGRAY, Color.LTGRAY,
            Color.LTGRAY, Color.LTGRAY, 0x77777777, null, null, "Phone-Landscape-Double-Black.png",
            R.drawable.bookmarkgray2x));
    themes.add(new Theme("Leaf", 0xFF1F7F0E, 0xffF8F7EA, 0xFF186D08, Color.LTGRAY, 0xFF186D08, 0xFF186D08,
            Color.DKGRAY, 0x22222222, null, null, null, R.drawable.bookmarkgray2x));
    themes.add(new Theme("", 0xFFA13A0A, 0xFFF6DFD9, 0xFFA13A0A, 0xFFDC4F0E, 0xFFA13A0A, 0xFFA13A0A,
            Color.DKGRAY, 0x22222222, null, null, null, R.drawable.bookmarkgray2x));
    this.setBrightness((float) setting.brightness);
    // create highlights object to contains highlights of this book. 
    highlights = new Highlights();
    Bundle bundle = getIntent().getExtras();
    fileName = bundle.getString("BOOKNAME");
    author = bundle.getString("AUTHOR");
    title = bundle.getString("TITLE");
    bookCode = bundle.getInt("BOOKCODE");
    if (pagePositionInBook == -1)
        pagePositionInBook = bundle.getDouble("POSITION");
    themeIndex = setting.theme;
    this.isGlobalPagination = bundle.getBoolean("GLOBALPAGINATION");
    this.isRTL = bundle.getBoolean("RTL");
    this.isVerticalWriting = bundle.getBoolean("VERTICALWRITING");
    this.isDoublePagedForLandscape = bundle.getBoolean("DOUBLEPAGED");
    //      if (this.isRTL) this.isDoublePagedForLandscape = false; // In RTL mode, SDK does not support double paged. 

    ePubView = new RelativeLayout(this);

    RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT,
            RelativeLayout.LayoutParams.FILL_PARENT);
    ePubView.setLayoutParams(rlp);

    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); // width,height
    if (this.getOSVersion() >= 11) {
        rv = new ReflowableControl(this); // in case that device supports transparent webkit, the background image under the content can be shown. in some devices, content may be overlapped.
    } else {
        rv = new ReflowableControl(this, getCurrentTheme().backgroundColor); // in case that device can not support transparent webkit, the background color will be set in one color.
    }

    // if false highlight will be drawed on the back of text - this is default. 
    // for the very old devices of which GPU does not support transparent webView background, set the value to true.  
    rv.setDrawingHighlightOnFront(false);

    // set the bookCode to identify the book file. 
    rv.bookCode = this.bookCode;

    // set bitmaps for engine. 
    rv.setPagesStackImage(this.getBitmap("PagesStack.png"));
    rv.setPagesCenterImage(this.getBitmap("PagesCenter.png"));
    // for epub3 which has page-progression-direction="rtl", rv.isRTL() will return true.
    // for old RTL epub which does not have <spine toc="ncx" page-progression-direction="rtl"> in opf file. 
    // you can enforce RTL mode.  

    /*      
          // delay times for proper operations. 
          // !! DO NOT SET these values if there's no issue on your epub reader. !!
          // !! if delayTime is decresed, performance will be increase
          // !! if delayTime is set to too low value, a lot of problem can be occurred. 
          // bringDelayTime(default 500 ms) is for curlView and mainView transition - if the value is too short, blink may happen.
          rv.setBringDelayTime(500);
          // reloadDelayTime(default 100) is used for delay before reload (eg. changeFont, loadChapter or etc) 
          rv.setReloadDelayTime(100);
          // reloadDelayTimeForRotation(default 1000) is used for delay before rotation
          rv.setReloadDelayTimeForRotation(1000);
          // retotaionDelayTime(default 1500) is used for delay after rotation.
          rv.setRotationDelayTime(1500);
          // finalDelayTime(default 500) is used for the delay after loading chapter. 
          rv.setFinalDelayTime(500);
          // rotationFactor affects the delayTime before Rotation. default value 1.0f
          rv.setRotationFactor(1.0f);      
          // If recalcDelayTime is too short, setContentBackground function failed to work properly.  
          rv.setRecalcDelayTime(2500);
    */

    // set the max width or height for background. 
    rv.setMaxSizeForBackground(1024);
    //      rv.setBaseDirectory(SkySetting.getStorageDirectory() + "/books");
    //      rv.setBookName(fileName);
    // set the file path of epub to open
    // Be sure that the file exists before setting.
    rv.setBookPath(SkySetting.getStorageDirectory() + "/books/" + fileName);
    // if true, double pages will be displayed on landscape mode. 
    rv.setDoublePagedForLandscape(this.isDoublePagedForLandscape);
    // set the initial font style for book. 
    rv.setFont(setting.fontName, this.getRealFontSize(setting.fontSize));
    // set the initial line space for book. 
    rv.setLineSpacing(this.getRealLineSpace(setting.lineSpacing)); // the value is supposed to be percent(%).
    // set the horizontal gap(margin) on both left and right side of each page.  
    rv.setHorizontalGapRatio(0.30);
    // set the vertical gap(margin) on both top and bottom side of each page. 
    rv.setVerticalGapRatio(0.22);
    // set the HighlightListener to handle text highlighting. 
    rv.setHighlightListener(new HighlightDelegate());
    // set the PageMovedListener which is called whenever page is moved. 
    rv.setPageMovedListener(new PageMovedDelegate());
    // set the SelectionListener to handle text selection. 
    rv.setSelectionListener(new SelectionDelegate());
    // set the pagingListener which is called when GlobalPagination is true. this enables the calculation for the total number of pages in book, not in chapter.   
    rv.setPagingListener(new PagingDelegate());
    // set the searchListener to search keyword.
    rv.setSearchListener(new SearchDelegate());
    // set the stateListener to monitor the state of sdk engine. 
    rv.setStateListener(new StateDelegate());
    // set the clickListener which is called when user clicks
    rv.setClickListener(new ClickDelegate());
    // set the bookmarkListener to toggle bookmark
    rv.setBookmarkListener(new BookmarkDelegate());
    // set the scriptListener to set custom javascript. 
    rv.setScriptListener(new ScriptDelegate());

    // enable/disable scroll mode
    rv.setScrollMode(false);

    // for some anroid device, when rendering issues are occurred, use "useSoftwareLayer"
    //      rv.useSoftwareLayer();
    // In search keyword, if true, sdk will return search result with the full information such as position, pageIndex. 
    rv.setFullSearch(true);
    // if true, sdk will return raw text for search result, highlight text or body text without character escaping.  
    rv.setRawTextRequired(false);

    // if true, sdk will read the content of book directry from file system, not via Internal server. 
    //      rv.setDirectRead(true);

    // If you want to make your own provider, please look into EpubProvider.java in Advanced demo.
    //      EpubProvider epubProvider = new EpubProvider();
    //      rv.setContentProvider(epubProvider);      

    // SkyProvider is the default ContentProvider which is presented with SDK. 
    // SkyProvider can read the content of epub file without unzipping. 
    // SkyProvider is also fully integrated with SkyDRM solution.  
    SkyProvider skyProvider = new SkyProvider();
    skyProvider.setKeyListener(new KeyDelegate());
    rv.setContentProvider(skyProvider);

    // set the start positon to open the book. 
    rv.setStartPositionInBook(pagePositionInBook);
    // DO NOT USE BELOW, if true , sdk will use DOM to highlight text.  
    //      rv.useDOMForHighlight(false);
    // if true, globalPagination will be activated. 
    // this enables the calculation of page number based on entire book ,not on each chapter.
    // this globalPagination consumes huge computing power. 
    // AVOID GLOBAL PAGINATION FOR LOW SPEC DEVICES.
    rv.setGlobalPagination(this.isGlobalPagination);
    // set the navigation area on both left and right side to go to the previous or next page when the area is clicked. 
    rv.setNavigationAreaWidthRatio(0.1f); // both left and right side.
    // set the device locked to prevent Rotation. 
    rv.setRotationLocked(setting.lockRotation);
    isRotationLocked = setting.lockRotation;
    // set the mediaOverlayListener for MediaOverlay.
    rv.setMediaOverlayListener(new MediaOverlayDelegate());
    // set the audio playing based on Sequence. 
    rv.setSequenceBasedForMediaOverlay(false);

    params.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
    params.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
    params.width = LayoutParams.MATCH_PARENT;
    params.height = LayoutParams.MATCH_PARENT;

    rv.setLayoutParams(params);
    this.applyThemeToRV(themeIndex);

    if (this.isFullScreenForNexus && SkyUtility.isNexus() && Build.VERSION.SDK_INT >= 19) {
        rv.setImmersiveMode(true);
    }
    // If you want to get the license key for commercial use, please email us (skytree21@gmail.com). 
    // Without the license key, watermark message will be shown in background. 
    rv.setLicenseKey("a99b-3914-a63b-8ecb");

    // set PageTransition Effect 
    int transitionType = bundle.getInt("transitionType");
    if (transitionType == 0) {
        rv.setPageTransition(PageTransition.None);
    } else if (transitionType == 1) {
        rv.setPageTransition(PageTransition.Slide);
    } else if (transitionType == 2) {
        rv.setPageTransition(PageTransition.Curl);
    }

    // setCurlQuality effects the image quality when tuning page in Curl Transition Mode. 
    // If "Out of Memory" occurs in high resolution devices with big screen, 
    // this value should be decreased like 0.25f or below.
    if (this.getMaxSize() > 1280) {
        rv.setCurlQuality(0.5f);
    }

    // set the color of text selector. 
    rv.setSelectorColor(getCurrentTheme().selectorColor);
    // set the color of text selection area. 
    rv.setSelectionColor(getCurrentTheme().selectionColor);

    // setCustomDrawHighlight & setCustomDrawCaret work only if SDK >= 11
    // if true, sdk will ask you how to draw the highlighted text
    rv.setCustomDrawHighlight(true);
    // if true, sdk will require you to draw the custom selector.
    rv.setCustomDrawCaret(true);

    rv.setFontUnit("px");

    rv.setFingerTractionForSlide(true);
    rv.setVideoListener(new VideoDelegate());

    // make engine not to send any event to iframe
    // if iframe clicked, onIFrameClicked will be fired with source of iframe
    // By Using that source of iframe, you can load the content of iframe in your own webView or another browser. 
    rv.setSendingEventsToIFrameEnabled(false);

    // make engine send any event to video(tag) or not
    // if video tag is clicked, onVideoClicked will be fired with source of iframe
    // By Using that source of video, you can load the content of video in your own media controller or another browser. 
    rv.setSendingEventsToVideoEnabled(true);

    // make engine send any event to video(tag) or not
    // if video tag is clicked, onVideoClicked will be fired with source of iframe
    // By Using that source of video, you can load the content of video in your own media controller or another browser.
    rv.setSendingEventsToAudioEnabled(true);

    // if true, sdk will return the character offset from the chapter beginning , not from element index.
    // then startIndex, endIndex of highlight will be 0 (zero) 
    rv.setGlobalOffset(true);
    // if true, sdk will return the text of each page in the PageInformation object which is passed in onPageMoved event. 
    rv.setExtractText(true);

    ePubView.addView(rv);

    this.makeControls();
    this.makeBoxes();
    this.makeIndicator();
    this.recalcFrames();
    if (this.isRTL) {
        this.seekBar.setReversed(true);
    }
    setContentView(ePubView);
    this.isInitialized = true;
}

From source file:com.amsterdam.marktbureau.makkelijkemarkt.DagvergunningFragment.java

/**
 * Get data retrieved with the intent, or restore state
 * @param savedInstanceState the previously saved state
 *//*from  w w  w.j  a va  2s  .  c  o  m*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // initialize the producten & vaste producten values
    String[] productParams = getResources().getStringArray(R.array.array_product_param);
    for (String product : productParams) {
        mProducten.put(product, -1);
        mProductenVast.put(product, -1);
    }

    // get settings from the shared preferences
    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext());
    mMarktId = settings.getInt(getString(R.string.sharedpreferences_key_markt_id), 0);
    mActiveAccountId = settings.getInt(getString(R.string.sharedpreferences_key_account_id), 0);
    mActiveAccountNaam = settings.getString(getString(R.string.sharedpreferences_key_account_naam), null);

    // get the date of today for the dag param
    SimpleDateFormat sdf = new SimpleDateFormat(getString(R.string.date_format_dag));
    mDagToday = sdf.format(new Date());

    // only on fragment creation, not on rotation/re-creation
    if (savedInstanceState == null) {

        // check if we are editing an existing dagvergunning or making a new one
        Intent intent = getActivity().getIntent();
        if ((intent != null) && (intent.hasExtra(
                MakkelijkeMarktProvider.mTableDagvergunning + MakkelijkeMarktProvider.Dagvergunning.COL_ID))) {
            int dagvergunningId = intent.getIntExtra(
                    MakkelijkeMarktProvider.mTableDagvergunning + MakkelijkeMarktProvider.Dagvergunning.COL_ID,
                    0);

            if (dagvergunningId != 0) {
                mId = dagvergunningId;
            }
        }

        // init loader if an existing dagvergunning was selected
        if (mId > 0) {

            // create an argument bundle with the dagvergunning id and initialize the loader
            Bundle args = new Bundle();
            args.putInt(MakkelijkeMarktProvider.Dagvergunning.COL_ID, mId);
            getLoaderManager().initLoader(DAGVERGUNNING_LOADER, args, this);

            // show the progressbar (because we are fetching the koopman from the api later in the onloadfinished)
            mProgressbar.setVisibility(View.VISIBLE);
        } else {

            // check time in hours since last fetched the sollicitaties for selected markt
            long diffInHours = getResources()
                    .getInteger(R.integer.makkelijkemarkt_api_sollicitaties_fetch_interval_hours);
            if (settings
                    .contains(getContext().getString(R.string.sharedpreferences_key_sollicitaties_last_fetched)
                            + mMarktId)) {
                long lastFetchTimestamp = settings.getLong(
                        getContext().getString(R.string.sharedpreferences_key_sollicitaties_last_fetched)
                                + mMarktId,
                        0);
                long differenceMs = new Date().getTime() - lastFetchTimestamp;
                diffInHours = TimeUnit.MILLISECONDS.toHours(differenceMs);
            }

            // if last sollicitaties fetched more than 12 hours ago, fetch them again
            if (diffInHours >= getResources()
                    .getInteger(R.integer.makkelijkemarkt_api_sollicitaties_fetch_interval_hours)) {

                // show progress dialog
                mGetSollicitatiesProcessDialog.show();
                ApiGetSollicitaties getSollicitaties = new ApiGetSollicitaties(getContext());
                getSollicitaties.setMarktId(mMarktId);
                getSollicitaties.enqueue();
            }
        }
    } else {

        // restore dagvergunning data from saved state
        mMarktId = savedInstanceState.getInt(MakkelijkeMarktProvider.Dagvergunning.COL_MARKT_ID);
        mDag = savedInstanceState.getString(MakkelijkeMarktProvider.Dagvergunning.COL_DAG);
        mId = savedInstanceState.getInt(MakkelijkeMarktProvider.Dagvergunning.COL_ID);
        mErkenningsnummer = savedInstanceState
                .getString(MakkelijkeMarktProvider.Dagvergunning.COL_ERKENNINGSNUMMER_INVOER_WAARDE);
        mErkenningsnummerInvoerMethode = savedInstanceState
                .getString(MakkelijkeMarktProvider.Dagvergunning.COL_ERKENNINGSNUMMER_INVOER_METHODE);
        mRegistratieDatumtijd = savedInstanceState
                .getString(MakkelijkeMarktProvider.Dagvergunning.COL_REGISTRATIE_DATUMTIJD);
        mRegistratieGeolocatieLatitude = savedInstanceState
                .getDouble(MakkelijkeMarktProvider.Dagvergunning.COL_REGISTRATIE_GEOLOCATIE_LAT);
        mRegistratieGeolocatieLongitude = savedInstanceState
                .getDouble(MakkelijkeMarktProvider.Dagvergunning.COL_REGISTRATIE_GEOLOCATIE_LONG);
        mTotaleLengte = savedInstanceState.getInt(MakkelijkeMarktProvider.Dagvergunning.COL_TOTALE_LENGTE);
        mSollicitatieStatus = savedInstanceState
                .getString(MakkelijkeMarktProvider.Dagvergunning.COL_STATUS_SOLLICITATIE);
        mKoopmanAanwezig = savedInstanceState.getString(MakkelijkeMarktProvider.Dagvergunning.COL_AANWEZIG);
        mKoopmanId = savedInstanceState.getInt(MakkelijkeMarktProvider.Dagvergunning.COL_KOOPMAN_ID);
        mKoopmanVoorletters = savedInstanceState.getString(MakkelijkeMarktProvider.Koopman.COL_VOORLETTERS);
        mKoopmanAchternaam = savedInstanceState.getString(MakkelijkeMarktProvider.Koopman.COL_ACHTERNAAM);
        mKoopmanFoto = savedInstanceState.getString(MakkelijkeMarktProvider.Koopman.COL_FOTO_URL);
        mRegistratieAccountId = savedInstanceState
                .getInt(MakkelijkeMarktProvider.Dagvergunning.COL_REGISTRATIE_ACCOUNT_ID);
        mRegistratieAccountNaam = savedInstanceState.getString(MakkelijkeMarktProvider.Account.COL_NAAM);
        mSollicitatieId = savedInstanceState.getInt(MakkelijkeMarktProvider.Dagvergunning.COL_SOLLICITATIE_ID);
        mSollicitatieNummer = savedInstanceState
                .getInt(MakkelijkeMarktProvider.Sollicitatie.COL_SOLLICITATIE_NUMMER);
        mNotitie = savedInstanceState.getString(MakkelijkeMarktProvider.Dagvergunning.COL_NOTITIE);
        mProducten = (HashMap<String, Integer>) savedInstanceState.getSerializable(STATE_BUNDLE_KEY_PRODUCTS);
        mProductenVast = (HashMap<String, Integer>) savedInstanceState
                .getSerializable(STATE_BUNDLE_KEY_PRODUCTS_VAST);
        mVervangerId = savedInstanceState.getInt(MakkelijkeMarktProvider.Dagvergunning.COL_VERVANGER_ID);
        mVervangerErkenningsnummer = savedInstanceState
                .getString(MakkelijkeMarktProvider.Dagvergunning.COL_VERVANGER_ERKENNINGSNUMMER);

        // select tab of viewpager from saved fragment state (if it's different)
        if (mViewPager.getCurrentItem() != mCurrentTab) {
            mViewPager.setCurrentItem(mCurrentTab);
        }
    }

    // set the right wizard menu depending on the current tab position
    setWizardMenu(mCurrentTab);

    // prevent the keyboard from popping up on first pager fragment load
    Utility.hideKeyboard(getActivity());

    //        // TODO: get credentials and payleven api-key from mm api
    //        // decrypt loaded credentials
    //        String paylevenMerchantEmail = "marco@langebeeke.com";
    //        String paylevenMerchantPassword = "unknown";
    //        String paylevenApiKey = "unknown";
    //
    //        // register with payleven api
    //        PaylevenFactory.registerAsync(
    //                getContext(),
    //                paylevenMerchantEmail,
    //                paylevenMerchantPassword,
    //                paylevenApiKey,
    //                new PaylevenRegistrationListener() {
    //                    @Override
    //                    public void onRegistered(Payleven payleven) {
    //                        mPaylevenApi = payleven;
    //                        Utility.log(getContext(), LOG_TAG, "Payleven Registered!");
    //                    }
    //                    @Override
    //                    public void onError(PaylevenError error) {
    //                        Utility.log(getContext(), LOG_TAG, "Payleven registration Error: " + error.getMessage());
    //                    }
    //                });

    // TODO: in the overzicht step change 'Opslaan' into 'Afrekenen' and show a payment dialog when clicked
    // TODO: if the bluetooth payleven cardreader has not been paired yet inform the toezichthouder, show instructions and open the bluetooth settings
    // TODO: give the toezichthouder the option in the payment dialog to save without payleven and make the payment with an old pin device?
    // TODO: the payment dialog shows:
    // - logo's of the accepted debit card standards
    // - total amount to pay
    //      (this can be the difference between a changed dagvergunning and an already paid amount,
    //      or the total amount if it is a new dagvergunning. we don't pay refunds using the app?
    //      refunds can be done by the beheerder using the dashboard?
    //      or do we allow refunds in the app? In that case we need to inform the toezichthouder
    //      that a refund will be made, and keep him informed about the status of the trasnaction)
    // - 'start payment/refund' button?
    // - instructions for making the payment using the payleven cardreader
    // - optionally a selection list to select the bluetooth cardreader if it was not yet selected before
    //      (if it was already selected before, show the selected reader with a 'wiebertje' in front. when
    //      clicked it will show the list of cardreaders that can be selected)
    // - status of the transaction
    // TODO: when the payment is done succesfully we safe the dagvergunning and close the dialog and the dagvergunning activity
}

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

private void restoreState(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        mMap = retrieveMap(mMap);/*from  w w w .ja  v a  2 s . c  o  m*/

        if (!mMapFailed) {
            boolean mapFailedBefore = savedInstanceState.getBoolean(OTPApp.BUNDLE_KEY_MAP_FAILED);

            if (mapFailedBefore) {
                enableUIElements(true);

                initializeMapInterface(mMap);
            }

            if (!mapFailedBefore) {
                String overlayString = mPrefs.getString(OTPApp.PREFERENCE_KEY_MAP_TILE_SOURCE,
                        mApplicationContext.getResources().getString(R.string.map_tiles_default_server));
                updateOverlay(overlayString);
            }

            setTextBoxLocation(savedInstanceState.getString(OTPApp.BUNDLE_KEY_TB_START_LOCATION), true);
            setTextBoxLocation(savedInstanceState.getString(OTPApp.BUNDLE_KEY_TB_END_LOCATION), false);
            CameraPosition camPosition = savedInstanceState.getParcelable(OTPApp.BUNDLE_KEY_MAP_CAMERA);
            if (camPosition != null) {
                mMap.moveCamera(CameraUpdateFactory.newCameraPosition(camPosition));
            }

            if ((mStartMarkerPosition = savedInstanceState
                    .getParcelable(OTPApp.BUNDLE_KEY_MAP_START_MARKER_POSITION)) != null) {
                mStartMarker = addStartEndMarker(mStartMarkerPosition, true);
            }
            if ((mEndMarkerPosition = savedInstanceState
                    .getParcelable(OTPApp.BUNDLE_KEY_MAP_END_MARKER_POSITION)) != null) {
                mEndMarker = addStartEndMarker(mEndMarkerPosition, false);
            }

            mIsStartLocationGeocodingCompleted = savedInstanceState
                    .getBoolean(OTPApp.BUNDLE_KEY_IS_START_LOCATION_GEOCODING_PROCESSED);
            mIsEndLocationGeocodingCompleted = savedInstanceState
                    .getBoolean(OTPApp.BUNDLE_KEY_IS_END_LOCATION_GEOCODING_PROCESSED);
            mAppStarts = savedInstanceState.getBoolean(OTPApp.BUNDLE_KEY_APP_STARTS);
            mIsStartLocationChangedByUser = savedInstanceState
                    .getBoolean(OTPApp.BUNDLE_KEY_IS_START_LOCATION_CHANGED_BY_USER);
            mIsEndLocationChangedByUser = savedInstanceState
                    .getBoolean(OTPApp.BUNDLE_KEY_IS_END_LOCATION_CHANGED_BY_USER);

            mSavedLastLocation = savedInstanceState.getParcelable(OTPApp.BUNDLE_KEY_SAVED_LAST_LOCATION);
            mSavedLastLocationCheckedForServer = savedInstanceState
                    .getParcelable(OTPApp.BUNDLE_KEY_SAVED_LAST_LOCATION_CHECKED_FOR_SERVER);

            showBikeParameters(false);

            mDdlTravelMode.setItemChecked(savedInstanceState.getInt(OTPApp.BUNDLE_KEY_DDL_TRAVEL_MODE), true);
            TraverseModeSpinnerItem traverseModeSpinnerItem = (TraverseModeSpinnerItem) mDdlTravelMode
                    .getItemAtPosition(mDdlTravelMode.getCheckedItemPosition());
            if (traverseModeSpinnerItem != null) {
                // This should always be the case because if it's stored it was already checked
                if (traverseModeSpinnerItem.getTraverseModeSet().contains(TraverseMode.BICYCLE)) {
                    setBikeOptimizationAdapter(true);
                    mDdlOptimization.setItemChecked(
                            savedInstanceState.getInt(OTPApp.BUNDLE_KEY_DDL_OPTIMIZATION), true);
                    OptimizeSpinnerItem optimizeSpinnerItem = (OptimizeSpinnerItem) mDdlOptimization
                            .getItemAtPosition(mDdlOptimization.getCheckedItemPosition());
                    if (optimizeSpinnerItem != null) {
                        if (optimizeSpinnerItem.getOptimizeType().equals(OptimizeType.TRIANGLE)) {
                            showBikeParameters(true);
                        }
                    }
                }
            }
            mDdlTravelMode.setItemChecked(savedInstanceState.getInt(OTPApp.BUNDLE_KEY_DDL_TRAVEL_MODE), true);

            OTPBundle otpBundle = (OTPBundle) savedInstanceState.getSerializable(OTPApp.BUNDLE_KEY_OTP_BUNDLE);
            if (otpBundle != null) {
                List<Itinerary> itineraries = otpBundle.getItineraryList();
                getFragmentListener().onItinerariesLoaded(itineraries);
                getFragmentListener().onItinerarySelected(otpBundle.getCurrentItineraryIndex());
                fillItinerariesSpinner(itineraries);
            }
            showRouteOnMap(getFragmentListener().getCurrentItinerary(), false);

            Date savedTripDate = (Date) savedInstanceState.getSerializable(OTPApp.BUNDLE_KEY_TRIP_DATE);
            if (savedTripDate != null) {
                mTripDate = savedTripDate;
            }
            mArriveBy = savedInstanceState.getBoolean(OTPApp.BUNDLE_KEY_ARRIVE_BY, false);

            if (savedInstanceState.getString(OTPApp.BUNDLE_KEY_RESULT_TRIP_START_LOCATION) != null) {
                mResultTripStartLocation = savedInstanceState
                        .getString(OTPApp.BUNDLE_KEY_RESULT_TRIP_START_LOCATION);
            }
            if (savedInstanceState.getString(OTPApp.BUNDLE_KEY_RESULT_TRIP_END_LOCATION) != null) {
                mResultTripEndLocation = savedInstanceState
                        .getString(OTPApp.BUNDLE_KEY_RESULT_TRIP_END_LOCATION);
            }

            mBikeTriangleMinValue = savedInstanceState.getDouble(OTPApp.BUNDLE_KEY_SEEKBAR_MIN_VALUE);
            mBikeTriangleMaxValue = savedInstanceState.getDouble(OTPApp.BUNDLE_KEY_SEEKBAR_MAX_VALUE);
            mBikeTriangleParameters.setSelectedMinValue(mBikeTriangleMinValue);
            mBikeTriangleParameters.setSelectedMaxValue(mBikeTriangleMaxValue);

            mIsStartLocationChangedByUser = false;
            mIsEndLocationChangedByUser = false;
        }
    }
}