Listview in Tablelayout in android -


in application have 1 tablelayout,and 1 database.now,i want display database content in table layout.but should listview because have show entries 1 below other.is possible have listview inside table layout,also give idea how set database entries in corresponding listview in table layout.

here xml structure:

<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" > <tablelayout android:id="@+id/tablelayout" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingright="2dip" > <tablerow> <textview android_layout_span="2" android:layout_weight="1" android:text="income" /> </tablerow> <tablerow> <textview android:layout_weight="1" android:text="price:"/> <textview android:layout_weight="1" android:text="price:" /> <listview android:id="@+id/listview1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" > </listview> </tablerow> <tablerow> <textview android:layout_weight="1" android:text="quantity:"/> <textview android:id="@+id/et_url" android:layout_weight="1" android:text="quantity:" /> </tablerow> </tablelayout> </scrollview> 

if need show data list/something list, why want use table layout making complex structure ??

use main list_view_layout in activity contains list view. create xml list_item & use in adapter show data 1 one. may use table layout or design wish in list_item's layout.

you better knowledge here @ vogella.com

just prepare data set, create list & adapter & use data in adapter... thats it!!

good luck :-)


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -