android - ListView with CursorAdapter does not display my values -


i want display of contents of database user scroll ability.

so have extended listactivity , used simplecursoradapter. problem can not see values displaced.

private void filldata() {  // of rows database , create item list listdata = data.findalldbvalues(); startmanagingcursor(listdata);  // create array specify fields want display in list string[] = new string[]{data.id, data.desc};  // , array of fields want bind fields  int[] = new int[]{r.id.text1, r.id.text2};  // create simple cursor adapter , set display  listadapter la = new simplecursoradapter(this, android.r.layout.simple_list_item_2, listdata, from, to);//r.layout.showdata setlistadapter(la);  } 

if use custom layout(r.layout.showdata),where has 2 textviews, can see values have touch text displayed job instead of touching anywhere of selection.

so want use simple_list_item_2 can have ability. ideas why not see values or how can make custom layout produce same abilities simple_list?

this worked me:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android_orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingleft="4dip" android:paddingright="5dp"> <textview android:id="@+id/productrow"     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="wrap_content" android:layout_height="wrap_content" /> </linearlayout> 

the trick wrap textview row in linearlayout. lets me click anywhere on list element select it.


Comments