V
V
vdvpie222016-06-23 10:07:20
Android
vdvpie22, 2016-06-23 10:07:20

How to save spinner value when using ViewPager android?

Good day,
I dynamically create drop-down lists, their number and content is not known in advance.
Faced a problem when switching between tabs (Fragments) in the ViewPager and
returning back the selected value is reset in the spinner.
I'm trying to setOnItemSelectedListener , but I noticed that when scrolling, it is again called and resets the value. Initially, the logic at the time of updating the fragment is to see if the spinner has a value, if it does not exist, then we set it to default.
What can you advise?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question