android-FlipView icon indicating copy to clipboard operation
android-FlipView copied to clipboard

Save state on orientation change

Open emilsjolander opened this issue 12 years ago • 5 comments

emilsjolander avatar Mar 31 '13 19:03 emilsjolander

Any progress on this issue? How I can save item position to show it on orientation change?

I tried to use flipTo(); method on onRestoreInstanceState but it gives error

rafaelekol avatar Feb 02 '14 07:02 rafaelekol

Not really looked into it yet but shouldn't be hard to fix. Have a look at the source and see if you can contribute that yourself. I might have time to look into it this week also

emilsjolander avatar Feb 04 '14 21:02 emilsjolander

I solved this issue, by feeding FlipView page position from SharedPreferences. I just store FlipView current page in onSaveInstanceState. So on each rotation FlipView reads page position from SharedPreferences

rafaelekol avatar Feb 05 '14 12:02 rafaelekol

you should probably save the position in the bundle passed to onSaveInstanceState instead

emilsjolander avatar Feb 05 '14 13:02 emilsjolander

I tried to do it with Bundle but couldn't make it :) I use SharedPreferences because I need to pass page position for from other activity too. Anyway using SharedPreferences solved my problem.

rafaelekol avatar Feb 05 '14 13:02 rafaelekol