I want to add iems to linearlayout dynamically, and want to change the text of the textviews in the inflated layout. The background of all the 14 orders is set but only text of the top textview is set. Rest of the blocks are blank
String infService = Context.LAYOUT_INFLATER_SERVICE;
inflater = (LayoutInflater)getBaseContext().getSystemService(infService);
for(Orders order:loop) {
View itemView = inflater.inflate(R.layout.search_result_item, ll,true);
textTitle = (TextView) itemView.findViewById(R.id.search_title);
textTitle.setText(order.getKey());
Log.i(" key ",order.getKey());
}
This the xml
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="75dip"
android:padding="5dip"
android:background="#ffffffff"
android:shrinkColumns="0"
android:stretchColumns="0"
>
<TableRow>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/chegg_nocorner_rounded"
android:id="@+id/search_layout1"
>
<ImageView android:id="@+id/search_icon"
android:layout_width="75dp"
android:layout_height="fill_parent"
android:layout_marginRight="10dip"
android:layout_alignParentLeft="true" />
<TextView android:id="@+id/search_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_toRightOf="@id/search_icon"
android:textSize="14sp"
android:textColor="#000000"
android:textStyle="bold"
android:lines="2"
android:ellipsize="end" />
<TextView android:id="@+id/search_isbn13"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/search_icon"
android:layout_below="@id/search_title"
android:textSize="12sp"
android:textColor="#555555"
android:singleLine="true"
android:ellipsize="end" />
<TextView android:id="@+id/search_authors"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/search_icon"
android:layout_below="@id/search_isbn13"
android:textSize="12sp"
android:textColor="#555555"
android:singleLine="true"
android:ellipsize="end" />
</RelativeLayout>
<ImageView
android:gravity="right"
android:layout_gravity="right|center_vertical"
android:src="@drawable/chevron"
android:padding="8dip" />
</TableRow>
</TableLayout>