Note that there are some explanatory texts on larger screens.

plurals
  1. POSave states of child rows with checkboxes in inflated expandablelistview
    primarykey
    data
    text
    <p>I have a working expandablelistview in my Android project, where each child contains an ImageView, a TextView, an EditText, and a Checkbox:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="50dp" android:background="#CCCCCC" android:orientation="horizontal" &gt; &lt;ImageView android:id="@+id/imgname" android:layout_width="50dp" android:layout_height="wrap_content" android:layout_alignParentTop="True" android:contentDescription="@+id/imgdesc" android:paddingLeft="1dp" android:scaleType="fitCenter" android:src="@drawable/logo_grey" /&gt; &lt;TableLayout android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_toLeftOf="@+id/check1" android:layout_toRightOf="@+id/imgname" android:stretchColumns="0" &gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/desc" android:layout_width="fill_parent" android:layout_height="wrap_content" android:focusable="false" android:textSize="13dp" android:background="#CCCCCC" android:textColor="#777777" android:textStyle="bold" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="fill_horizontal" &gt; &lt;EditText android:id="@+id/content" style="textViewStyle" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fadingEdge="none" android:focusable="true" android:hint="@+id/contenthint" android:isScrollContainer="true" android:minWidth="150dp" android:singleLine="false" android:textSize="10dp" android:textStyle="italic" &gt; &lt;/EditText&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;CheckBox android:id="@+id/check1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:focusable="false" android:gravity="right" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>For the purposes of writing to my SQLite database, I want to create a list which, for each child where the checkbox's value is true, contains the text from the TextView desc and the text from the EditText content, perhaps as an array of value pairs. The operation would be triggered by the user via a Button on the ExpandableListActivity. But I'm not sure how to identify the values of the widgets after inflating the view. I'd appreciate a little heads up, I've not been able to find a good answer online!</p>
    singulars
    1. This table or related slice is empty.
    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.
    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