Ok let me explain what "does not work perfectly" means.
I have a listview without the android:stackFromBottom="true"
parameter. I also have an ArrayAdapter with the regular getItem(position)
. I call my webserver, get the data on an asc date order.
This way the item in position 0 (top) of the list has the smallest date. And I can scroll top->bottom. Good.
I added android:stackFromBottom
and now I see that now you can start scolling from bottom->top but the item in position 0 is still the top item and has the smallest date. So the adapter has not changed its order.
The only way to solve this is to change getItem(getCount()-1-position)
inside the adapter. However I add and notify the adapter and the adapter will still add the items to the bottom.
I guess that the structure is ListView -> Adapter -> Row Views
so no matter the stackFromBottom
value, there is only one child, the adapter. Right?
Anyhow, how can have a ListView with Adapter in reverse order?
getItem
method. – Dayak