title: Dropdown Image not showing Properly In ExpandableListView
body: <p>I am new to Android. I have Created <code>ExpandableListView</code> in <code>NavigationView</code>.
  Inside that, I have a dropdown of images to show there is a subMenu.
  Lists are coming properly but When I click item to see the submenu, the dropdown image showing for all Items.it should show only for few items.</p>
  
  <p><img src="https://i.stack.imgur.com/S0LoF.png" alt="enter image description here"></p>
  
  <p><strong>here is my code:</strong></p>
  
  <p>Adapter:</p>
  
  <pre><code>public class ExpandableListAdapter extends BaseExpandableListAdapter {
  
  
  private Context context;
  private List&lt;MenuModel&gt; listDataHeader;
  private HashMap&lt;MenuModel, List&lt;MenuModel&gt;&gt; listDataChild;
  private int icon= -1;
  
  public ExpandableListAdapter(Context context, List&lt;MenuModel&gt; listDataHeader,
                               HashMap&lt;MenuModel, List&lt;MenuModel&gt;&gt; listChildData) {
      this.context = context;
      this.listDataHeader = listDataHeader;
      this.listDataChild = listChildData;
  }
  
  @Override
  public int getGroupCount() {
     return this.listDataHeader.size();
  }
  
  @Override
  public int getChildrenCount(int groupPosition) {
      if (this.listDataChild.get(this.listDataHeader.get(groupPosition)) == null)
          return 0;
      else
          return this.listDataChild.get(this.listDataHeader.get(groupPosition))
                  .size();
  }
  
  @Override
  public MenuModel getGroup(int groupPosition) {
     return this.listDataHeader.get(groupPosition);
  }
  
  @Override
  public MenuModel getChild(int groupPosition, int childPosition) {
      return this.listDataChild.get(this.listDataHeader.get(groupPosition))
              .get(childPosition);
  }
  
  @Override
  public long getGroupId(int groupPosition) {
      return groupPosition;
  }
  
  @Override
  public long getChildId(int groupPosition, int childPosition) {
      return groupPosition;
  }
  
  @Override
  public boolean hasStableIds() {
      return false;
  }
  
  @Override
  public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
      Log.d("groupPosition",""+groupPosition);
      String headerTitle = getGroup(groupPosition).menuName;
      boolean hasChildren = getGroup(groupPosition).hasChildren;
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) this.context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.list_group_header, null);
      }
  
      TextView lblListHeader = convertView.findViewById(R.id.lblListHeader);
     // lblListHeader.setTypeface(null, Typeface.BOLD);
      lblListHeader.setText(headerTitle);
      ImageView imageView = convertView.findViewById(R.id.dropdown);
  
  
      if (hasChildren) {
          imageView.setVisibility(View.VISIBLE);
          imageView.setImageResource(R.mipmap.ic_dropdown);
      }
  
  
      return convertView;
  }
  
  @Override
  public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
      final String childText = getChild(groupPosition, childPosition).menuName;
  
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) this.context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.list_group_child, null);
      }
  
      TextView txtListChild = convertView
              .findViewById(R.id.lblListItem);
  
      txtListChild.setText(childText);
      return convertView;
  }
  
  @Override
  public boolean isChildSelectable(int groupPosition, int childPosition) {
      return false;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>MainActivity:</p>
  
  <pre><code> private void prepareMenuData() {
  
      MenuModel menuModel = new MenuModel("Home", true, false); //Menu of Android Tutorial. No sub menus
      headerList.add(menuModel);
  
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
      menuModel = new MenuModel("My account", true, true); //Menu of Java Tutorials
      headerList.add(menuModel);
      List&lt;MenuModel&gt; childModelsList = new ArrayList&lt;&gt;();
      MenuModel childModel = new MenuModel("My Order", false, false);
      childModelsList.add(childModel);
  
      childModel = new MenuModel("Delivery Address", false, false);
      childModelsList.add(childModel);
  
      childModel = new MenuModel("My Profile", false, false);
      childModelsList.add(childModel);
      childModel = new MenuModel("My Loyalty Points", false, false);
      childModelsList.add(childModel);
      childModel = new MenuModel("Logout", false, false);
      childModelsList.add(childModel);
  
  
      if (menuModel.hasChildren) {
          Log.d("API123","here");
          childList.put(menuModel, childModelsList);
      }
  
      childModelsList = new ArrayList&lt;&gt;();
      menuModel = new MenuModel("Niche Market", true, true); //Menu of Python Tutorials
      headerList.add(menuModel);
      childModel = new MenuModel("Organic items", false, false);
      childModelsList.add(childModel);
  
      childModel = new MenuModel("Pollachi Special", false, false);
      childModelsList.add(childModel);
      childModel = new MenuModel("Imported Items", false, false);
      childModelsList.add(childModel);
  
      if (menuModel.hasChildren) {
          childList.put(menuModel, childModelsList);
      }
  
  
      menuModel = new MenuModel("Smart Basket", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
      childModelsList = new ArrayList&lt;&gt;();
      menuModel = new MenuModel("Category", true, true);
      headerList.add(menuModel);
      childModel = new MenuModel("Python AST – Abstract Syntax Tree", false, false);
      childModelsList.add(childModel);
  
      childModel = new MenuModel("Python Fractions", false, false);
      childModelsList.add(childModel);
  
      if (menuModel.hasChildren) {
          childList.put(menuModel, childModelsList);
      }
  
      menuModel = new MenuModel("Offers", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
      menuModel = new MenuModel("Cookbook", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
  
      menuModel = new MenuModel("Food and Sharing", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
      menuModel = new MenuModel("Speciality Store", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
      menuModel = new MenuModel("Scheduled Shopping", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
  
      menuModel = new MenuModel("Notifications", true, false);
      headerList.add(menuModel);
      if (!menuModel.hasChildren) {
          childList.put(menuModel, null);
      }
  
      childModelsList = new ArrayList&lt;&gt;();
      menuModel = new MenuModel("Customer service", true, true);
      headerList.add(menuModel);
      childModel = new MenuModel("Contact", false, false);
      childModelsList.add(childModel);
  
      childModel = new MenuModel("Feedback", false, false);
      childModelsList.add(childModel);
      childModel = new MenuModel("FAQ", false, false);
      childModelsList.add(childModel);
  
      if (menuModel.hasChildren) {
          childList.put(menuModel, childModelsList);
      }
  
  }
  
  private void populateExpandableList() {
  
      expandableListAdapter = new ExpandableListAdapter(MainActivity.this, headerList, childList);
      for (int i=0;i&lt;headerList.size();i++) {
          Log.d("has",""+headerList.get(i).hasChildren);
      }
      expandableListView.setAdapter(expandableListAdapter);
  
      expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
          @Override
          public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
  
              if (headerList.get(groupPosition).isGroup) {
                  if (!headerList.get(groupPosition).hasChildren) {
                     loadHomeFragment();
                      onBackPressed();
                  }
              }
  
              return false;
          }
      });
  
      expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
          @Override
          public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
  
  
              return false;
          }
      });
  }
  </code></pre>