How can I save the ListView‘s scroll position when the ListView is situated within a ListFragment?
How can I save the ListView ‘s scroll position when the ListView is situated
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Finally I solved the problem, so I decided to post the solution for others:
Within my ListFragment sub class I declared two int variables to hold the scroll position
Then override the onPause() and onResume() to save and restore the
ListView‘s scroll positions as follows:That’s it!! I hope this will help some one. 🙂