Search code examples
androidlistactivityselecteditemradiobuttonlist

Displaying a specific part of list in Android


I have a list activity. This displays a list of radio button selections. When I select something, I save that selection and when I return to the list, the same radiobutton is highlighted.

Is there a way, to display the part of the list that has the selection when the list comes up for the first time, instead of displaying the start of the list?


Solution

  • You can use listView.setSelection(int savedPosition) to set the selected position.