H
H
HolidayR2018-08-03 14:12:36
Java
HolidayR, 2018-08-03 14:12:36

How to save the zoom of the map and restore the zoom values ​​when returning to the map?

There are two activities: the first is a map, the second is just an empty activity. The scenario is as follows: they twisted, moved the map (the first activity), pressed the button - they switched to the second activity. Next, click on the cross in the second activity, which Intent returns us to the first activity to the map. But I would like to return to the same point on the map and with the same zoom. How to implement it correctly? Whereby?
There is no problem returning the same point. But how to save the zoom of the map and restore the zoom values ​​when returning to the map?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2018-08-03
@HolidayR

It is necessary to return back not by intent, but by calling finish (). Most likely this will solve your problem. And on one instance, you can save the state in onSaveInstanceState

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question