@Override
        public void onClick(View v) {

          if (v != null) {
            final int position =
                ((ExpandableListActivity) context).getExpandableListView().getPositionForView(v)
                    - 1; // Give the position of parent view
            Log.d("" + position, "checkposition");
            final long packedPosition =
                ((ExpandableListActivity) context)
                    .getExpandableListView()
                    .getExpandableListPosition(position);
            Log.d("" + packedPosition, "checkposition");
            ((ExpandableListActivity) context).getExpandableListView();

            // final int packedPosition =
            // ((ExpandableListActivity)context).getExpandableListView().getExpandableListPosition(position);
            final int groupPosition = ExpandableListView.getPackedPositionGroup(packedPosition);
            if (groupPosition != AdapterView.INVALID_POSITION) {

              mCallBack = (OnGroupClickListener) ((Activity) context);
              mCallBack.OnGroupClick(
                  groupPosition, groupItem.get(groupPosition).getDescription().toString(), "copy");
            }
          }
        }
Example #2
0
 public EndlessListAdapter(ExpandableListActivity activity, int progressItemLayoutResId) {
   this(activity, activity.getExpandableListView(), progressItemLayoutResId);
 }