i need to get the position of an groupView by clicking on a button in the child.
some kind of:
Parent
-child
-child
-child <-Button witch onCLickListener in ExpandableBaseAdapter class
Parent
-child
-child
_...
i've been searhing for hourse to solve my problem, but i dont get it. How should i get the number/name of the Parent in the action that is done in the onClicklistener?
Heres is the method in the BaseAdapter (extends BaseExpandableListAdapter)
@Override
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
final String childText = (String)getChild(groupPosition, childPosition);
if(convertView==null){
LayoutInflater inflater =(LayoutInflater)this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView=inflater.inflate(R.layout.list_item, null);
Button save = (Button)convertView.findViewById(R.id.Button_item_hinzufuegen);
save.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//get the groupPosition
}
});