@Override public View getGroupView( final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.group, null); } ImageButton btn = (ImageButton) convertView.findViewById(R.id.discardBtn); btn.setFocusable(false); btn.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "group with time " + titles.get(groupPosition) + " clicked!"); } }); CheckedTextView tw = (CheckedTextView) convertView.findViewById(R.id.checkedTW); Title title = titles.get(groupPosition); tw.setText(title.getDate()); tw.setChecked(isExpanded); TextView coordsView = (TextView) convertView.findViewById(R.id.coordsView); coordsView.setText( "Floor: " + title.getZ() + ". Position [" + title.getX() + ", " + title.getY() + "]"); return convertView; }