Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:13:09+00:00 2026-06-13T19:13:09+00:00

I am trying to take an expandable list view that I have already created

  • 0

I am trying to take an expandable list view that I have already created and change the color of the background of one of the items in the list of groups. I only want to change the color of the entry in the main list, not its drop down children, aka the part that you click on to expand or hide the other parts. I think getGroupView will do this, but I can’t figure out how to make this work. If this is the proper method to use, can someone explain how to use it? If there is a better way, what is it?

[Edit] I played around with it some more, and figured out how to use getGroupView somewhat, but I am still having a problem. What I am doing to my understanding should be only changing the color of a single entry, but instead it changes them all. Here is the code:

    View listViewRow = findViewById(R.layout.menu_item);
    listViewRow = myNewAdapter.getGroupView(2, false, listViewRow, expandView);
    listViewRow.setBackgroundColor(Color.RED);

where menu_item is the name of the layout file that I am using for the groups in the expandable list, and expandView is the expandableListView.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:13:10+00:00Added an answer on June 13, 2026 at 7:13 pm

    try with this in extended BaseExpandableListAdapter class

    public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {
    
       if (convertView == null) {
        LayoutInflater inflater =  (LayoutInflater) myContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.group_row, null);
       }
    
       TextView tvGroupName = (TextView) convertView.findViewById(R.id.tvGroupName);
       tvGroupName.setText(list.get(groupPosition).getYear() +" COLLECTION");
    
       return convertView;
      }
    

    OR refrer this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to take a list of 40,000 items and run a json request
I am trying to take text that the user inputs in a text view
I'm trying to take a numbered list created in Outlook and manipulate it based
I have a datagridview with 9 columns. I am simply trying take the value
trying to take this content: <div class=content>one,two,three</div> <div class=content>four,five,six</div> <div class=content>seven,eight,nine</div> and .split and
I am trying to take one form type and display it however times i
I'm trying to take a xml document and transform to a standard html list
I am trying to take a string that has HTML, strip out some tags
I am trying to take favicons and add them to a dynamic image that
I'm trying take the names that I am given by the program after it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.