Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>ChildView getView()</code> this method, when your judge convertview equals null, you must <code>convertview.setTag(viewHolder)</code>. When your clicked parent view second, the convertview is not equals null, your must use this <code>viewholder= (ViewHolder)convertview.getTag()</code>; </p> <pre><code> public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View view = convertView; ChildViewHolder viewHolder = null; if (view == null) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.member_childitem2, null); viewHolder = new ChildViewHolder(); viewHolder.checkBox1 = (CheckBox)view.findViewById(R.id.checkbox1); viewHolder.checkBox2 = (CheckBox)view.findViewById(R.id.checkbox2); viewHolder.checkBox3 = (CheckBox)view.findViewById(R.id.checkbox3); viewHolder.checkBox4 = (CheckBox)view.findViewById(R.id.checkbox4); viewHolder.checkBox5 = (CheckBox)view.findViewById(R.id.checkbox5); viewHolder.checkBox6 = (CheckBox)view.findViewById(R.id.checkbox6); view.setTag(viewHolder); }else{ viewHolder = (ChildViewHolder) view.getTag(); } Button btn_submit = (Button)view.findViewById(R.id.btn_submit); View groupView = cachedGroupView.get(childPosition); final GroupViewHolder groupViewHolder = (GroupViewHolder) groupView.getTag(); btn_submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Toast.makeText(context, groupPosition+ ":" + childPosition, Toast.LENGTH_SHORT).show(); groupViewHolder.groupStatus.setImageResource(R.drawable.indicator_close); } }); return view; } </code></pre>
    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.
    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