I use this code for my simple ListView now:
final ListView lv = (ListView)findViewById(R.id.apps_list);
lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, myString.split("\n")));
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
}
});
and layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
style="?android:attr/listSeparatorTextViewStyle"
android:id="@+id/separator_apps"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/apps" />
<ListView
android:id="@+id/apps_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_below="@+id/separator_apps" >
</ListView>
</RelativeLayout>
But I need to add Image and CheckBox to every row to THIS ListView, could someone give me a good example?