I’ve an activity with various TABS and one of them has a Single Choice Mode ListView, that’s populated with a SimpleCursorAdapter.
Cursor c = db.listaPessoas(APRESENTACAO);
startManagingCursor(c);
SimpleCursorAdapter sca = new SimpleCursorAdapter(formPessoa.this,android.R.layout.select_dialog_singlechoice, c, new String[] {"nome"}, new int[] {android.R.id.text1});
pessoasInseridas.setAdapter(sca);
sca.notifyDataSetChanged();
The problem is when I change to another Tab and get back to the Tab that has the ListView, the selected item of the ListView is no longer selected (the green highlight disappear from the radio button). How can I keep the state of an item on a ListView?
try this