This is driving me crazy!

I have two applications with this problem, and I'm about to give up.
I'm out of ideas.

In these applications, I've constructed a pattern for the ListView
very similar to the Gmail app. I'm fetching information from the
server in small sets, and when a user scrolls down to the last
ListView position, he sees a download progress row. If something goes
wrong, that download row switches to an error row with an error
message and a button to retry the network request. When the data set
is retrieved, the ListView is updated at the bottom with the new data
set. The download view and the error view are done with ListView
footers.

So far, so good. It works greak. The problem is when the user clicks
an item in the ListView in order to go to another Activity. When he
comes back the the ListView, it resets the ListView, so that the first
visible position is always the first item of the ListView.

If I remove all the footer code, then it works as expected, and the
ListView remembers it's position when it comes back.

I use the getFirstVisiblePosition() and the setSelection() to
workaround this, although it's ugly because the ListView always shifts
a little. But even these are buggy and sometimes (about 5% of the
times) the getFirstVisiblePosition() returns 0. This just adds to the
frustration.

I'm about to give up on footers and eradicate them of my Android
vocabulary and stick with the Window title  indeterminate progress.

But... how does the Gmail app does it?! Does any one have an idea?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to