@Override
    public View getGroupView(int groupPosition, boolean isExpanded,
            View convertView, ViewGroup parent) {
        String headerTitle = (String) getGroup(groupPosition);
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.list_group, null);
        }
        //Switch switch1 = (Switch) convertView.findViewById(R.id.switch1);
        TextView lblHeader = (TextView) convertView
                .findViewById(R.id.categorytv);
        lblHeader.setTypeface(null, Typeface.BOLD);
        lblHeader.setText(headerTitle);


        return convertView;
    }
1

There are 1 answers

0
sham raj On

After a long research I am able to figure out here is the solution that has worked out.

For the Switch

    <Switch
    android:id="@+id/switch1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:focusable="false"/>

so after this my expandable list view started working as expected.