List of usage examples for android.os Bundle getDouble
public double getDouble(String key, double defaultValue)
From source file:com.binomed.showtime.android.screen.widget.results.CineShowTimeResultsWidgetActivity.java
@Override protected void onPreRestoreBundle(Bundle savedInstanceState) { if (savedInstanceState != null) { boolean saved = savedInstanceState.getBoolean(ParamIntent.BUNDLE_SAVE, false); if (saved) { getModelActivity().setNearResp((NearResp) savedInstanceState.getParcelable(ParamIntent.NEAR_RESP)); getModelActivity().setForceResearch( savedInstanceState.getBoolean(ParamIntent.ACTIVITY_SEARCH_FORCE_REQUEST, false)); intentResult = new Intent(); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_FORCE_REQUEST, false); String cityName = savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_CITY); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_CITY, cityName); getModelActivity().setCityName(cityName); Double latitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_SEARCH_LATITUDE, 0); Double longitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_SEARCH_LONGITUDE, 0); if ((latitude != 0) && (longitude != 0)) { intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_LATITUDE, latitude); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_LONGITUDE, longitude); Location location = new Location("GPS"); location.setLatitude(latitude); location.setLongitude(longitude); getModelActivity().setLocalisation(location); }/*from w ww. ja v a2 s .c o m*/ } } }
From source file:org.onebusaway.android.report.ui.InfrastructureIssueActivity.java
/** * Setting up the location helper/* w ww . j av a2 s . c o m*/ * IssueLocationHelper helps tracking the issue location and issue stop */ private void setupLocationHelper(Bundle savedInstanceState) { double lat; double lon; if (savedInstanceState == null) { lat = getIntent().getDoubleExtra(MapParams.CENTER_LAT, 0); lon = getIntent().getDoubleExtra(MapParams.CENTER_LON, 0); } else { lat = savedInstanceState.getDouble(MapParams.CENTER_LAT, 0); lon = savedInstanceState.getDouble(MapParams.CENTER_LON, 0); } Location mapCenterLocation = LocationUtils.makeLocation(lat, lon); mIssueLocationHelper = new IssueLocationHelper(mapCenterLocation, this); // Set map center location mMapFragment.setMapCenter(mapCenterLocation, true, false); }
From source file:org.y20k.trackbook.MainActivityMapFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // create basic map mMapView = new MapView(inflater.getContext()); // get map controller mController = mMapView.getController(); // basic map setup mMapView.setTileSource(TileSourceFactory.MAPNIK); mMapView.setTilesScaledToDpi(true);/* ww w .ja va 2 s.c o m*/ // add multi-touch capability mMapView.setMultiTouchControls(true); // add compass to map CompassOverlay compassOverlay = new CompassOverlay(mActivity, new InternalCompassOrientationProvider(mActivity), mMapView); compassOverlay.enableCompass(); mMapView.getOverlays().add(compassOverlay); // initiate map state if (savedInstanceState != null) { // restore saved instance of map GeoPoint position = new GeoPoint( savedInstanceState.getDouble(INSTANCE_LATITUDE_MAIN_MAP, DEFAULT_LATITUDE), savedInstanceState.getDouble(INSTANCE_LONGITUDE_MAIN_MAP, DEFAULT_LONGITUDE)); mController.setCenter(position); mController.setZoom(savedInstanceState.getInt(INSTANCE_ZOOM_LEVEL_MAIN_MAP, 16)); // restore current location mCurrentBestLocation = savedInstanceState.getParcelable(INSTANCE_CURRENT_LOCATION); } else if (mCurrentBestLocation != null) { // fallback or first run: set map to current position GeoPoint position = convertToGeoPoint(mCurrentBestLocation); mController.setCenter(position); mController.setZoom(16); } // inform user that new/better location is on its way if (mFirstStart && !mTrackerServiceRunning) { Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_acquiring_location), Toast.LENGTH_LONG).show(); mFirstStart = false; } // load track from saved instance if (savedInstanceState != null) { mTrack = savedInstanceState.getParcelable(INSTANCE_TRACK_MAIN_MAP); } // mark user's location on map if (mCurrentBestLocation != null && !mTrackerServiceRunning) { mMyLocationOverlay = MapHelper.createMyLocationOverlay(mActivity, mCurrentBestLocation, LocationHelper.isNewLocation(mCurrentBestLocation)); mMapView.getOverlays().add(mMyLocationOverlay); } return mMapView; }
From source file:com.binomed.showtime.android.screen.results.CineShowTimeResultsActivity.java
@Override protected void onPreRestoreBundle(Bundle savedInstanceState) { if (savedInstanceState != null) { boolean saved = savedInstanceState.getBoolean(ParamIntent.BUNDLE_SAVE, false); if (saved) { getModelActivity().setNearResp((NearResp) savedInstanceState.getParcelable(ParamIntent.NEAR_RESP)); intentResult = new Intent(); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_FORCE_REQUEST, savedInstanceState.getBoolean(ParamIntent.ACTIVITY_SEARCH_FORCE_REQUEST, false)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_CITY, savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_CITY)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_MOVIE_NAME, savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_MOVIE_NAME)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_THEATER_ID, savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_THEATER_ID)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_DAY, savedInstanceState.getInt(ParamIntent.ACTIVITY_SEARCH_DAY, 0)); intentResult.putIntegerArrayListExtra(ParamIntent.ACTIVITY_SEARCH_GROUP_EXPAND, savedInstanceState.getIntegerArrayList(ParamIntent.ACTIVITY_SEARCH_GROUP_EXPAND)); Double latitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_SEARCH_LATITUDE, -1); Double longitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_SEARCH_LONGITUDE, -1); if ((latitude != -1) && (longitude != -1)) { intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_LATITUDE, latitude); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_LONGITUDE, longitude); }//from w w w. java2 s . com } } }
From source file:us.socialgoodworking.mocklocation.MockLocationActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Logging.debug(TAG, TAG, "onCreate"); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar().setDisplayUseLogoEnabled(true); Drawable d = getResources().getDrawable(R.drawable.socialgoodworking_ab_back1); getSupportActionBar().setBackgroundDrawable(d); btnStartStop = (Button) findViewById(R.id.btnStartStop); btnStartStop.setVisibility(View.GONE); btnStartStop.setOnClickListener(clickListener); btnStartStop.setTextColor(getResources().getColorStateList(R.color.button_colors)); currentRouteLocationIndex = 0;//from w w w .j a v a 2s . c o m if (savedInstanceState != null) { Logging.debug(TAG, "onCreate", "savedInstanceState != null"); double lat; double lng; currentMode = savedInstanceState.getInt("mode", TAP_MODE); bStarted = savedInstanceState.getBoolean("started", false); lat = savedInstanceState.getDouble("currentLat", defaultLatLng.latitude); lng = savedInstanceState.getDouble("currentLng", defaultLatLng.longitude); currentLatLng = new LatLng(lat, lng); lat = savedInstanceState.getDouble("previousLat", defaultLatLng.latitude); lng = savedInstanceState.getDouble("previousLng", defaultLatLng.longitude); previousLatLng = new LatLng(lat, lng); currentRoute = savedInstanceState.getString("currentRoute"); currentRouteLocationIndex = savedInstanceState.getInt("index", 0); } else { Logging.debug(TAG, "onCreate", "savedInstanceState =!= null"); currentMode = TAP_MODE; currentRoute = ""; } try { mockLocation = new MockLocation.MockLocationBuilder(getApplicationContext(), providerName).build(); mockLocation.removeProvider(); mockLocation.setUpMockProvider(); Logging.debug(TAG, "onCreate", "mockLocation instance created"); } catch (SecurityException se) { Logging.debug(TAG, "onCreate", se.getMessage()); mockPermissionEnabled = false; showSecurityErrorDlg(); } setUpMapIfNeeded(); handler = new Handler(); }
From source file:org.y20k.trackbook.MainActivityTrackFragment.java
@Nullable @Override/* w ww. jav a 2 s .com*/ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // inflate root view from xml mRootView = inflater.inflate(R.layout.fragment_main_track, container, false); // get reference to onboarding layout mOnboardingView = (LinearLayout) mRootView.findViewById(R.id.track_tab_onboarding); // get reference to basic map mMapView = (MapView) mRootView.findViewById(R.id.track_map); // get map controller mController = mMapView.getController(); // basic map setup mMapView.setTileSource(TileSourceFactory.MAPNIK); mMapView.setTilesScaledToDpi(true); // add multi-touch capability mMapView.setMultiTouchControls(true); // add compass to map CompassOverlay compassOverlay = new CompassOverlay(mActivity, new InternalCompassOrientationProvider(mActivity), mMapView); compassOverlay.enableCompass(); // move the compass overlay down a bit compassOverlay.setCompassCenter(35.0f, 80.0f); mMapView.getOverlays().add(compassOverlay); // initiate map state if (savedInstanceState != null) { // restore saved instance of map GeoPoint position = new GeoPoint( savedInstanceState.getDouble(INSTANCE_LATITUDE_TRACK_MAP, DEFAULT_LATITUDE), savedInstanceState.getDouble(INSTANCE_LONGITUDE_TRACK_MAP, DEFAULT_LONGITUDE)); mController.setCenter(position); mController.setZoom(savedInstanceState.getInt(INSTANCE_ZOOM_LEVEL_MAIN_MAP, 16)); } else { mController.setZoom(16); } // get views for track selector mTrackManagementLayout = (LinearLayout) mRootView.findViewById(R.id.track_management_layout); mDropdown = (Spinner) mRootView.findViewById(R.id.track_selector); // attach listeners to export and delete buttons ImageButton exportButton = (ImageButton) mRootView.findViewById(R.id.export_button); ImageButton deleteButton = (ImageButton) mRootView.findViewById(R.id.delete_button); exportButton.setOnClickListener(getExportButtonListener()); deleteButton.setOnClickListener(getDeleteButtonListener()); // get views for statistics sheet View statisticsView = mRootView.findViewById(R.id.statistics_view); View statisticsSheet = mRootView.findViewById(R.id.statistics_sheet); mDistanceView = (TextView) mRootView.findViewById(R.id.statistics_data_distance); mStepsView = (TextView) mRootView.findViewById(R.id.statistics_data_steps); mWaypointsView = (TextView) mRootView.findViewById(R.id.statistics_data_waypoints); mDurationView = (TextView) mRootView.findViewById(R.id.statistics_data_duration); mRecordingStartView = (TextView) mRootView.findViewById(R.id.statistics_data_recording_start); mRecordingStopView = (TextView) mRootView.findViewById(R.id.statistics_data_recording_stop); // display map and statistics if (savedInstanceState != null) { // get track from saved instance and display map and statistics mTrack = savedInstanceState.getParcelable(INSTANCE_TRACK_TRACK_MAP); displayTrack(); } else if (mTrack == null) { // load track and display map and statistics LoadTrackAsyncHelper loadTrackAsyncHelper = new LoadTrackAsyncHelper(); loadTrackAsyncHelper.execute(); } else { // just display map and statistics displayTrack(); } // set up and show statistics sheet mStatisticsSheetBehavior = BottomSheetBehavior.from(statisticsSheet); mStatisticsSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); mStatisticsSheetBehavior.setBottomSheetCallback(getStatisticsSheetCallback()); statisticsView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (mStatisticsSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) { mStatisticsSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); } else { mStatisticsSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } } }); return mRootView; }
From source file:ru.neverdark.phototools.fragments.SunsetFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.message("Enter"); super.onCreateView(inflater, container, savedInstanceState); mView = inflater.inflate(R.layout.activity_sunset, container, false); mContext = mView.getContext();//from w w w .ja v a 2s. co m bindObjectsToResources(); setOnClickListeners(mEditTextDate); setOnClickListeners(mButtonCalculate); setOnClickListeners(mEditTextLocation); setOnClickListeners(mLabelAstroSunrise); setOnClickListeners(mLabelAstroSunset); setOnClickListeners(mLabelCivilSunrise); setOnClickListeners(mLabelCivilSunset); setOnClickListeners(mLabelNauticalSunrise); setOnClickListeners(mLabelNauticalSunset); setOnClickListeners(mLabelOfficialSunrise); setOnClickListeners(mLabelOfficialSunset); setEditTextLongClick(mEditTextDate); setEditTextLongClick(mEditTextLocation); if (savedInstanceState != null) { mLatitude = savedInstanceState.getDouble(Constants.LOCATION_LATITUDE, 0.0); mLongitude = savedInstanceState.getDouble(Constants.LOCATION_LONGITUDE, 0.0); mSelectionId = savedInstanceState.getLong(Constants.LOCATION_SELECTION_ID, Constants.LOCATION_CURRENT_POSITION_CHOICE); Log.variable("mSelectionId", String.valueOf(mSelectionId)); String timeZoneId = savedInstanceState.getString(Constants.LOCATION_TIMEZONE); if (timeZoneId == null) { timeZoneId = TimeZone.getDefault().getID(); } mTimeZone = TimeZone.getTimeZone(timeZoneId); mIsVisibleResult = savedInstanceState.getBoolean(Constants.LOCATION_IS_VISIVLE_RESULT, false); mAstroSunrise = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_ASTRO_SUNRISE)); mAstroSunset = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_ASTRO_SUNSET)); mCivilSunrise = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_CIVIL_SUNRISE)); mCivilSunset = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_CIVIL_SUNSET)); mNauticalSunrise = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_NAUTICAL_SUNRISE)); mNauticalSunset = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_NAUTICAL_SUNSET)); mOfficialSunrise = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_OFFICIAL_SUNRISE)); mOfficialSunset = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_OFFICIAL_SUNSET)); mLocationName = nullToEmpty(savedInstanceState.getString(Constants.LOCATION_NAME_DATA)); } else { initDate(); setTextLocation(); } updateDate(); setVisibleCalculculationResult(); return mView; }
From source file:gov.wa.wsdot.android.wsdot.ui.trafficmap.TrafficMapActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { AndroidInjection.inject(this); super.onCreate(savedInstanceState); setContentView(R.layout.map);/* w w w . j a va2 s. com*/ enableAds(getString(R.string.traffic_ad_target)); mProgressBar = findViewById(R.id.progress_bar); mToolbar = findViewById(R.id.toolbar); setSupportActionBar(mToolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } // Setup bounding box for Seattle area. seattleArea.add(new LatLonItem(48.01749, -122.46185)); seattleArea.add(new LatLonItem(48.01565, -121.86584)); seattleArea.add(new LatLonItem(47.27737, -121.86310)); seattleArea.add(new LatLonItem(47.28109, -122.45911)); // Initialize AsyncTasks mRestAreasOverlayTask = new RestAreasOverlayTask(); // Check preferences and set defaults if none set SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this); clusterCameras = settings.getBoolean("KEY_CLUSTER_CAMERAS", false); showCameras = settings.getBoolean("KEY_SHOW_CAMERAS", true); showAlerts = settings.getBoolean("KEY_SHOW_ALERTS", true); showCallouts = settings.getBoolean("KEY_SHOW_CALLOUTS", true); showRestAreas = settings.getBoolean("KEY_SHOW_REST_AREAS", false); latitude = Double.parseDouble(settings.getString("KEY_TRAFFICMAP_LAT", "47.5990")); longitude = Double.parseDouble(settings.getString("KEY_TRAFFICMAP_LON", "-122.3350")); zoom = settings.getInt("KEY_TRAFFICMAP_ZOOM", 12); // Check if we came from favorites/MyRoutes/alert if (savedInstanceState != null) { extrasRead = savedInstanceState.getBoolean("read_extras", false); } if (!extrasRead) { Bundle b = getIntent().getExtras(); if (b != null) { if (getIntent().hasExtra("lat")) latitude = b.getDouble("lat", latitude); if (getIntent().hasExtra("long")) longitude = b.getDouble("long", longitude); if (getIntent().hasExtra("zoom")) zoom = b.getInt("zoom", zoom); getIntent().getExtras().clear(); } extrasRead = true; } mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this) .addOnConnectionFailedListener(this).addApi(LocationServices.API).build(); mLocationCallback = new LocationCallback() { @Override public void onLocationResult(LocationResult locationResult) { if (locationResult == null) { return; } onNewLocation(locationResult.getLastLocation()); } }; MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.mapview); mapFragment.getMapAsync(this); favoriteMapLocationViewModel = ViewModelProviders.of(this, viewModelFactory) .get(FavoriteMapLocationViewModel.class); mapCameraViewModel = ViewModelProviders.of(this, viewModelFactory).get(MapCameraViewModel.class); mapCameraViewModel.init(null); setUpFabMenu(); MyLogger.crashlyticsLog("Traffic", "Screen View", "TrafficMapActivity", 1); // check for travel charts new TravelChartsAvailableTask().execute(); }
From source file:org.onebusaway.android.report.ui.InfrastructureIssueActivity.java
@Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); if (savedInstanceState != null) { mShowCategories = savedInstanceState.getBoolean(SHOW_CATEGORIES, false); mShowStopMarker = savedInstanceState.getBoolean(SHOW_STOP_MARKER, false); mShowArrivalListFragment = savedInstanceState.getBoolean(ARRIVAL_LIST, false); mRestoredServiceName = savedInstanceState.getString(RESTORED_SERVICE); mAgencyName = savedInstanceState.getString(AGENCY_NAME); mTransitServiceIssueTypeWithoutStop = savedInstanceState.getString(SELECTED_SERVICE_TYPE); mIsAllTransitHeuristicMatch = savedInstanceState.getBoolean(HEURISTIC_MATCH); String bundleStopId = savedInstanceState.getString(MapParams.STOP_ID); String stopName = savedInstanceState.getString(MapParams.STOP_NAME); String stopCode = savedInstanceState.getString(MapParams.STOP_CODE); if (bundleStopId != null) { double lat = savedInstanceState.getDouble(MapParams.CENTER_LAT, 0); double lon = savedInstanceState.getDouble(MapParams.CENTER_LON, 0); Location location = LocationUtils.makeLocation(lat, lon); mIssueLocationHelper.updateMarkerPosition(location, new ObaStopElement(bundleStopId, lat, lon, stopName, stopCode)); }//from w w w.java2 s .c om String infoText = savedInstanceState.getString(SHOW_INFO); if (infoText != null) { addInfoText(infoText); } if (mShowArrivalListFragment) { removeTripProblemFragment(); showArrivalListFragment(mIssueLocationHelper.getObaStop()); } } }
From source file:com.binomed.showtime.android.screen.results.tablet.CineShowTimeResultsTabletActivity.java
@Override protected void onPreRestoreBundle(Bundle savedInstanceState) { if (savedInstanceState != null) { boolean saved = savedInstanceState.getBoolean(ParamIntent.BUNDLE_SAVE, false); if (saved) { // Restore results getModelActivity().setNearResp((NearResp) savedInstanceState.getParcelable(ParamIntent.NEAR_RESP)); intentResult = new Intent(); getModelActivity().setForceResearch( savedInstanceState.getBoolean(ParamIntent.ACTIVITY_SEARCH_FORCE_REQUEST, false)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_FORCE_REQUEST, getModelActivity().isForceResearch()); getModelActivity().setCityName(savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_CITY)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_CITY, getModelActivity().getCityName()); getModelActivity()//from w w w. jav a 2 s .c o m .setMovieName(savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_MOVIE_NAME)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_MOVIE_NAME, getModelActivity().getMovieName()); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_THEATER_ID, savedInstanceState.getString(ParamIntent.ACTIVITY_SEARCH_THEATER_ID)); getModelActivity().setDay(savedInstanceState.getInt(ParamIntent.ACTIVITY_SEARCH_DAY, 0)); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_DAY, getModelActivity().getDay()); ArrayList<Integer> expandGroup = savedInstanceState .getIntegerArrayList(ParamIntent.ACTIVITY_SEARCH_GROUP_EXPAND); getModelActivity().setGroupExpanded(new HashSet<Integer>(expandGroup)); intentResult.putIntegerArrayListExtra(ParamIntent.ACTIVITY_SEARCH_GROUP_EXPAND, expandGroup); // We manage expand Groups if ((expandGroup != null) && (expandGroup.size() > 0) && (getModelActivity().getNearResp() .getTheaterList().size() < expandGroup.get(expandGroup.size() - 1))) { movieList = new ArrayList<MovieBean>(); theater = getModelActivity().getNearResp().getTheaterList() .get(expandGroup.get(expandGroup.size() - 1)); for (String movieId : theater.getMovieMap().keySet()) { movieList.add(getModelActivity().getNearResp().getMapMovies().get(movieId)); } } Double latitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_SEARCH_LATITUDE, 0); Double longitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_SEARCH_LONGITUDE, 0); if ((latitude != 0) && (longitude != 0)) { intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_LATITUDE, latitude); intentResult.putExtra(ParamIntent.ACTIVITY_SEARCH_LONGITUDE, longitude); } // Restore movie MovieBean movie = savedInstanceState.getParcelable(ParamIntent.MOVIE); if (movie != null) { TheaterBean theater = savedInstanceState.getParcelable(ParamIntent.THEATER); latitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_MOVIE_LATITUDE, -1); longitude = savedInstanceState.getDouble(ParamIntent.ACTIVITY_MOVIE_LONGITUDE, -1); intentStartMovieActivity = new Intent(this, CineShowTimeMovieActivity.class); intentStartMovieActivity.putExtra(ParamIntent.MOVIE_ID, movie.getId()); intentStartMovieActivity.putExtra(ParamIntent.MOVIE, movie); intentStartMovieActivity.putExtra(ParamIntent.THEATER_ID, theater.getId()); intentStartMovieActivity.putExtra(ParamIntent.THEATER, theater); intentStartMovieActivity.putExtra(ParamIntent.ACTIVITY_MOVIE_LATITUDE, latitude != -1 ? latitude : null); intentStartMovieActivity.putExtra(ParamIntent.ACTIVITY_MOVIE_LONGITUDE, longitude != -1 ? longitude : null); StringBuilder place = new StringBuilder(); if (theater != null) { if (theater.getPlace() != null) { if ((theater.getPlace().getCityName() != null // ) && (theater.getPlace().getCityName().length() > 0)) { place.append(theater.getPlace().getCityName()); } if ((theater.getPlace().getPostalCityNumber() != null // ) && (theater.getPlace().getPostalCityNumber().length() > 0)) { place.append(" ").append(theater.getPlace().getPostalCityNumber()); } if ((theater.getPlace().getCountryNameCode() != null // ) && (theater.getPlace().getCountryNameCode().length() > 0 // ) && (place.length() > 0)) { place.append(", ").append(theater.getPlace().getCountryNameCode()); //$NON-NLS-1$ } if (place.length() == 0) { place.append(theater.getPlace().getSearchQuery()); } } } intentStartMovieActivity.putExtra(ParamIntent.ACTIVITY_MOVIE_NEAR, place.toString()); Fragment fragmentRecycle = getSupportFragmentManager().findFragmentById(R.id.fragmentInfo); if ((fragmentRecycle != null) && (fragmentRecycle.getClass() == CineShowTimeMovieFragment.class)) { fragmentMovie = (CineShowTimeMovieFragment) fragmentRecycle; } else { fragmentMovie = new CineShowTimeMovieFragment(); } if ((fragmentRecycle != null) && !fragmentMovie.equals(fragmentRecycle)) { getSupportFragmentManager().beginTransaction().replace(R.id.fragmentInfo, fragmentMovie) .commit(); } } } } }