Note that there are some explanatory texts on larger screens.

plurals
  1. POExpandableListView child item's CheckBox gets checked randomly
    primarykey
    data
    text
    <p>I created an ExpandableListView with a quite complex child item xml. It contains a TextView, a Checkbox and an EditText. Here is the CheckBox part:</p> <pre><code> &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="55dip" android:orientation="horizontal" android:stretchColumns="0"&gt; &lt;TableRow&gt; android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/lblListItem" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="14dip" android:paddingTop="2dp" android:paddingBottom="2dp" android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft"/&gt; &lt;CheckBox android:id="@+id/cboxIsRel" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;/CheckBox&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>If I check the 1st item, in every group the 5th item is also gets checked (if the 2nd is selected, then the 6th gets selected). </p> <p>Why do they get also selected?</p> <p><strong>UPDATE:</strong></p> <p>In the <code>getChildView</code> method I have this code:</p> <pre><code>if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = infalInflater.inflate(R.layout.expandable_list_item, null); } TextView txtListChild = (TextView) convertView.findViewById(R.id.lblListItem); txtListChild.setText(childText); </code></pre> <p>If I don't use the convertView check, then the checkbox isn't reused but also the selected checkbox gets unselected if I scroll out.</p>
    singulars
    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