I have expanded list view, which contains 15 items, when i reaches to the bottom i load 15 more. When i get the 15 more, i called adapter.notifyDataSetChanged() , then list moves to the top, so lost my current selection. I wanted, list should add more but it should goes to bottom, my selection stat should not be changed, like gmail app. They added new items at bottom silently. How to achieve this?
Share
You can set the
selectionModeof yourListViewtoListView.CHOICE_MODE_SINGLE.By default
ListViewhas aCHOICE_MODE_NONE. Setting it to eitherCHOICE_MODE_SINGLEorCHOICE_MODE_MULTIPLEwill keep your selected item(s)’s state.You can read more on this topic in Android Developers’ article about Touch Mode