I have an xml with one textveiw and one edittext in it .I used this xml to get different rows in the list view of another xml file to list the data in that page.
The xml file that is used to list data in listview is as given below
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="2dip"
android:paddingBottom="0dip">
<TextView
android:id="@+id/tv_Sort_Address"
android:layout_width="0dip"
style="@style/ListTextViewStyle"
android:layout_height="wrap_content"
android:text="No"
android:layout_weight="2"/>
<EditText
android:textColor="#000000"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:inputType="number"
style="@style/EditTextStyle"
android:background="@android:drawable/editbox_background"
android:id="@+id/et_Sort_Order"
android:layout_weight="1">
</EditText>
</LinearLayout>
I filled the Listview with data on another xml fils as given below
simpleAdapter = new SimpleAdapter(this, alist,
R.layout.sort_order_list_row, new String[] { "Sort_Address",
"Sort_FKDeliveryStatus", "Sort_PKDelivery",
"Sort_DeliveryOrder" }, new int[] {
R.id.tv_Sort_Address, R.id.tv_Sort_FKDeliveryStatus,
R.id.tv_Sort_PKDelivery, R.id.et_Sort_Order });
listSortOrder.setAdapter(simpleAdapter);
The problem with me is that if i have two row in the listview and when i
placed a value in one of edit text row and move on to the another rows edit text the value placed in the first row got disappered.
<ListView android:id="@+id/lv_Sort_Order"
style="@style/ListTextBackGround"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dip"
android:descendantFocusability="afterDescendants"
android:layout_marginRight="5dip" >
</ListView>
to solve this I placed android:descendantFocusability="afterDescendants" in the list view page to get focus on to the merged page. But it didn’t solve the problem. Will anyone help me please.
Is there any property I need to be placed in the list view or in the merged Page?
1 Answer