So you have a ViewPager and your first page is an Android map. When you add or replace a new Fragment on the next page, your map resets when you go back to the first page.
Sadly, there is no way to retain its state. The only way you can do is to keep a reference on the map’s position by calling googleMap.getCameraPosition() and saving that in onSaveInstanceState() and restoring it in onCreate() or wherever.
Then you can reposition the map’s position and its zoom level by calling googleMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
Once you have the LatLngBounds object, you can easily get the center point by calling getCenter(). The LatLngBounds class also has a variable called northeast that returns a LatLng object representing the north east point of the bounds.
What you need to do then is to get the distance between these 2 points which we will use as the radius of the circle.
We can accomplish this by placing the 2 LatLng points inside a Location object and calling the Location class’ distanceTo() method.
That’s it! Add the LatLng center object to the CircleOptions class and set the distance as the radius of the circle.