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

  • SEARCH
  • Home
  • 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 8777877
In Process

The Archive Base Latest Questions

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

I have stored the names and friends in database. For example , person A,and

  • 0

I have stored the names and friends in database.

For example ,

person A,and his friends B,C,D 
person Z,and his friends K,L,M 
person Q,and his friends P,O,N 

How to retrieve values from database and display in a expandable listview.

i,e.Person A,Z,Q should be the group names and corresponding friends should be the child Name ….

Thanks in advance

  • 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:23:12+00:00Added an answer on June 13, 2026 at 7:23 pm

    Create wrapper for your person

    public class Person {
    
        String name;
        String[] friends;
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public String[] getFriends() {
            return friends;
        }
    
        public void setFriends(String[] friends) {
            this.friends = friends;
        }
    
    }
    

    Then put person name to your ParentView
    and Friends to a Child in the BaseExpandableListAdapter

    public class ExpandableListAdapter extends BaseExpandableListAdapter {
    List<Person>persons; // fill persons
    
    public View getGroupView(int groupPosition, boolean isExpanded,
                    View convertView, ViewGroup parent) {
    persons.get(groupPosition).getName();
    }
    
    public View getChildView(int groupPosition, int childPosition,
                    boolean isLastChild, View convertView, ViewGroup parent) {
    persons.get(groupPosition).getFriends();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example: I have a list of friends which I retrieve as XML from a
I have an a users friends stored in the database as friends_array . They
I have first names stored in one table and last names stored in another.
If I have function names stored as strings in a Hashtable. Is there a
I have group of stored procedures with names like 'somename_%'. Are there any way
I have 3 tables friends posts members friends ======== id, to, from (user_id's), status
I have friends table where there are stored two friends' IDs. When I query,
I have created a seperate .cs file names aNameClass.cs and have stored the following
Using MS SQL Server .I have made a Stored Procedure named SP_Get_CallsLogged . I
I have a table that stores employee names and years they worked. The columns

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.