Android ViewPager save previous page on onPageSelected

Viewed 4053

I have a ViewPager with pages of WebView. A page has a text field allowing the user to type in contents. I'd like to save the page's input text to a Java variable when moving between pages (by sliding forward/backward).

Unfortunately, it seems onPageSelected only tells me the page number that is about to display, and not the page it came from, which means I can't tell which page I needed to save at the time when the user changes page.

Any ideas? Many thanks in advance!

1 Answers
Related