Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid ExpandableListView with custom Child
    primarykey
    data
    text
    <p>I am trying to achieve something like the image below , i thought expandable list view can help me but it is not working . when expanding the parent , nothing shows up.</p> <p>am i doing wrong using expandable list view ? , is there anything i should go with.? <img src="https://i.imgur.com/pqZCYeG.png" alt="image"></p> <p>Please help..</p> <p>EDIT : Adapter class code :</p> <p>`public class ExpandableListAdapter extends android.widget.BaseExpandableListAdapter {</p> <pre><code>private Activity context; private List&lt;String&gt; students; public ExpandableListAdapter(Activity context, List&lt;String&gt; studentIds) { this.context = context; this.students = studentIds; } public Object getChild(int groupPosition, int childPosition) { return null; } public long getChildId(int groupPosition, int childPosition) { return childPosition; } public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { final String laptop = (String) getChild(groupPosition, childPosition); LayoutInflater inflater = context.getLayoutInflater(); if (convertView == null) { convertView = inflater.inflate(R.layout.attendance_view, null); } CheckBox isPresent = (CheckBox) convertView.findViewById(R.id.is_present); EditText absentReason = (EditText) convertView.findViewById(R.id.absent_reason); return convertView; } public int getChildrenCount(int groupPosition) { return 1; } public Object getGroup(int groupPosition) { return laptops.get(groupPosition); } public int getGroupCount() { return students.size(); } public long getGroupId(int groupPosition) { return groupPosition; } public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { String studentName= (String) getGroup(groupPosition); if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = infalInflater.inflate(R.layout.group_item, null); } TextView item = (TextView) convertView.findViewById(R.id.studentIds); item.setTypeface(null, Typeface.BOLD); item.setText(studentName); return convertView; } public boolean hasStableIds() { return true; } public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } </code></pre> <p>}`</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.
    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