Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I faced the same prob...N referring to the above answers i coded...here's what i found...</p> <ul> <li>Make sure SimplerExpandableListAdapters extends BaseExpandableListAdapter and implements OnChildClickListener.</li> <li>Add onchildclick as customExpandableList.setOnChildClickListener(new MyCustomAdapter(MainActivity.this, )). *<em>"argument" is what u receive in the SimplerExpandableListAdapter class. *</em>"MyCustomAdapter" should be replaced with your ExpandableListAdapter(SimplerExpandableListAdapter in ur case)</li> </ul> <p>I'm jus adding a code snippet for reference...</p> <pre><code> public class MyCustomAdapter extends BaseExpandableListAdapter implements OnChildClickListener { private LayoutInflater inflater; private ArrayList&lt;Parent&gt; mParent; </code></pre> <p>And add the onchildclick inside the Adapterclass. As shown</p> <pre><code> public class MyCustomAdapter extends BaseExpandableListAdapter implements OnChildClickListener { private LayoutInflater inflater; private ArrayList&lt;Parent&gt; mParent; public MyCustomAdapter(Context context, ArrayList&lt;Parent&gt; parent) { mParent = parent; inflater = LayoutInflater.from(context); } @Override public boolean onChildClick(ExpandableListView arg0, View arg1, int arg2, int arg3, long arg4) { // TODO Auto-generated method stub Log.d("trial", "ExpandableList= "+arg0+" ,View= "+arg1+" ,arg2= "+arg2+", arg3= "+arg3+", arg4= "+arg4); return true; } } </code></pre> <p>Add call the the onChildclickListener in the activity where the Expandableview is coded.(MainActivity class in my example).</p> <pre><code> mExpandableList.setOnChildClickListener(new MyCustomAdapter(MainActivity.this, arrayParents)); </code></pre>
    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.
    1. VO
      singulars
      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