How do I check if setChoiceModel is not null?

advertisements

I want to create a effect that if the checkbox of the ListView is checked, the string will be underlined. However I am not sure how to check if the checkbox is not null, or is check? Is there any build in method to do it?

fieldToEdit = (EditText) findViewById(R.id.todoEditText);
listToView = (ListView) findViewById(R.id.listViewOfItems);

final ArrayAdapter<String> adpt=new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_multiple_choice, ar);
listToView.setAdapter(adpt);
listToView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);


To check listview item in CHOICE_MODE_MULTIPLE

use methods:

setItemChecked (int position, boolean value)

isItemChecked (int position)

getCheckedItemPosition ()

Use can use more methods provided in the link.