3

I want to set the first visible item in a listView in, for example, 15. I try this and it works perfectly:

adapter = new HistoricAdapter(activity, lista);
getListView().smoothScrollToPosition(15);
setListAdapter(adapter);

but this doesn´t work:

adapter = new HistoricAdapter(activity, lista);
getListView().setSelection(15);
setListAdapter(adapter);

why? I want the second option but it doesn´t work :-(

Susana Mar Flores
  • 2,478
  • 1
  • 18
  • 16

0 Answers0