What I have: a custom listview with Textviews and checkbox.
I have a good alternative for a CheckBox. You can use android:state_activated="true" for your ListView rows. It does not lose its state and does not require lots of code.
Here is how to works
active_row.xml in your drawable folder
android:background="@drawable/active_row.xml"android:choiceMode="multipleChoice"You can check the State of every row like this
View v;
LinearLayout yourRowLayout;
for (int i = 0; i < yourListView.getChildCount(); i++) {
v = yourListView.getChildAt(i);
yourRowLayout = (LinearLayout) v.findViewById(R.id. yourRowLayout);
if(yourRowLayout.isActivated()){.... } }