I’m building an Android app that is basically an RSS reader, with different topics separated into tabs using an Activity based TabHost.
I have a menu command called “Refresh” that basically fires off an AsyncTask and parses the RSS feeds, and stores the feeds in a SQLLite table on the device.
When a user clicks on a tab I’m passing a topic id to the Activity to only pull that topic’s items from the database. In onResume is when I’m refreshing the feeds, so at they click on each tab, they get the most recent items.
My issue is, that when a user clicks on an RSS item, it open the item in their browser, but when they click the back button, it should remember their position. However, pressing back kicks off onResume and refreshes the feeds, so it auto scroll back up to the top.
There might be an obvious solution that I’m missing, but I’m having a hard time coming up with a good solution.
In your
onPause()method, record where the user is looking so that youronResume()method can position the view at the place the user left off.