views:

38

answers:

1

Hi,

I wish to work with checked list views wherein only one item can be selected at a time. Some queries related to this:

1) Is it advised to work with CheckedTextView as the ListView items, or a combination of CheckBox and TextView?

2) If using CheckedTextView, the text comes first and the checkbox appears on right edge. Is it possible to make the checkbox come on the left of the TextView?

3) How can I make one of the items as checked in onCreate()?

Note: I am using array adapter and calling setAdapter() to populate list.

Regards, Kiki

+1  A: 

You need to extend ArrayAdapter and use LayoutInflater to inflate the row layout as you need. This way you have full flexibility in list creation.

Please check this example, where basic idea is described:

Custom list view

Desiderio