I don't think you can, but you can save your CameraPosition , which has your position / scale / angle ...
http://developer.android.com/reference/com/google/android/gms/maps/model/CameraPosition.html
so that you can write a function in onDestroy that receives a CameraPosition from your map and stores it in SharedPreferences . In onCreate() you recreate your CameraPosition from SharedPreferences (after your map has been created).
// somewhere in your onDestroy() @Override protected void onDestroy() { CameraPosition mMyCam = MyMap.getCameraPosition(); double longitude = mMyCam.target.longitude; (...) SharedPreferences settings = getSharedPreferences("SOME_NAME", 0); SharedPreferences.Editor editor = settings.edit(); editor.putDouble("longitude", longitude); (...) //put all other values like latitude, angle, zoom... editor.commit(); }
in onCreate()
SharedPreferences settings = getSharedPreferences("SOME_NAME", 0); // "initial longitude" is only used on first startup double longitude = settings.getDouble("longitude", "initial_longitude"); (...) //add the other values LatLng startPosition = new LatLng() //with longitude and latitude CameraPosition cameraPosition = new CameraPosition.Builder() .target(startPosition) // Sets the center of the map to Mountain View .zoom(17) // Sets the zoom .bearing(90) // Sets the orientation of the camera to east .tilt(30) // Sets the tilt of the camera to 30 degrees .build(); // Creates a CameraPosition from the builder
create a new camera and configure it. make sure the card is installed at this point
map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
source share