Я создал один просмотр списка, в каждой строке которого есть флажок и текст, мне нужно получить какой-то текст в списке, где флажок установлен в true (установлен) Это мне нужно передать текстовые значения, которые выбираются из списка, используя флажок.
Это мой код:
gatwayList = (ListView) findViewById(R.id.gatwaylist);
ArrayList<HashMap<String,String>> wholeDetailsList = new ArrayList<HashMap<String,String>>();
for (int i = 0; i < 5; i++)
{
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", "Test+ i");
//map.put("address", wrap_address);
wholeDetailsList.add(map);
}
SimpleAdapter wholeDetailsAdapter = new SimpleAdapter(this,
wholeDetailsList, R.layout.gatway_row, new String[] {"name"}, new int[] {R.id.gatwayId});
gatwayList.setCacheColorHint(0);
gatwayList.setAdapter(wholeDetailsAdapter);
gatway_row.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<CheckBox
android:id="@+id/check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4px"
android:layout_alignParentLeft="true"
android:layout_marginRight="10px" >
</CheckBox>
<TextView android:id="@+id/gatwayId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ffff"
android:textSize="18dip"
android:layout_marginTop="15dip"
android:layout_marginLeft="60dip"
android:textStyle="bold"
android:textColor="#000000"/>
</RelativeLayout>
Список выглядит как
В этом случае я должен передать все значения. только выбранное значение. Любые комментарии будут оценены?