I was following the ListView official tutorial - [url]http://developer.android.com/resources/tutorials/views/hello-listview.html[/url], because I get the entries dinamically through a webservice.
Problem is, I want to place checkboxes at it. I have this
(aux (String [] aux) is previously and correctly fullfilled before this)
setListAdapter(new ArrayAdapter<CheckBox>(this,R.layout.row, convertToListItem(aux)));
And I think the problem is on my row.xml
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:typeface="normal" android:textStyle="normal"
android:layout_weight="0" android:layout_gravity="left" />
or in this function
private List<CheckBox> convertToListItem(String[] aux2){
List<CheckBox> result = new ArrayList<CheckBox>();
ArrayList<CheckBox> boxes = new ArrayList<CheckBox>();
for (String text : aux2){
CheckBox temp = new CheckBox(this);
temp.append(text);
temp.setText(text,BufferType.NORMAL);
result.add(temp);
boxes.add(temp);
}
return result;
What happens is: it appears the checkbox, but in front instead the right text it appears "android.widget.Checkbox@...."
What am I doing wrong ?