Sir i want to use OnChildClickListener in my class which is extended to the ExpandableListView please help me out.
My code is as follow.
public class CustExpListview extends ExpandableListView implements ExpandableListView.OnChildClickListener {
int intGroupPosition, intChildPosition, intGroupid;
ArrayList<Team> team;
public CustExpListview(Context context,ArrayList<Team> team)
{
super(context);
this.team = team;
}
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
widthMeasureSpec = MeasureSpec.makeMeasureSpec(960, MeasureSpec.AT_MOST);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(900, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
Toast.makeText(getApplicationContext(), "Hello \t" + team.get(groupPosition).players.get(childPosition) , Toast.LENGTH_LONG).show();
return false;
}
}
1 Answer(s)