Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use checkbox in listview (which have multilines in each list) and extends Listactivity?
    primarykey
    data
    text
    <p>this is my program which extends ListActivity and in each list I have multilines, picture and checkbox so I try like this</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); List&lt;Map&lt;String, Object&gt;&gt; resourceNames =new ArrayList&lt;Map&lt;String, Object&gt;&gt;(); Map&lt;String, Object&gt; data1,data2; data1 = new HashMap&lt;String, Object&gt;(); data2 = new HashMap&lt;String, Object&gt;(); data1.put("line1", "adidas Chelsea Tee-Womens" ); data1.put("line2", "$ 129.0" ); data1.put("img", R.drawable.q1 ); resourceNames.add(data1); data2.put("line1", "Chelsea Track Top-Womens" ); data2.put("line2", "$ 399.0" ); data2.put("img", R.drawable.q2 ); resourceNames.add(data2); SimpleAdapter notes = new SimpleAdapter( this, resourceNames, R.layout.row, new String[] {"line1","line2", "img" }, new int[] { R.id.text1, R.id.text2, R.id.img } ); setListAdapter(notes); } </code></pre> <p>and I wonder how to get value from each checkbox in each list</p> <p>this is my row.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:padding="6dip"&gt; &lt;CheckBox android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/CheckBox&gt; &lt;ImageView android:id="@+id/img" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:src="@drawable/icon" /&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@+id/text1" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="2" android:gravity="center_vertical" /&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:id="@+id/text2" android:singleLine="true" android:ellipsize="marquee" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload