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 6617743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:44:26+00:00 2026-05-25T20:44:26+00:00

I have a basic object called Employee . You can retrieve an Employee’s name

  • 0

I have a basic object called Employee. You can retrieve an Employee’s name and id using .getName() and .getId().

I want to use Jeff Sharkey’s SeparatedListAdapter to build a sectioned list. For the list items though, I need to use my custom Employee objects for the items instead of just lists of Strings.

In the included examples for the SeparatedListAdapter, he uses an ArrayAdapter<String> and a SimpleAdapter() for populating the list.

Is there any way to use a custom object/class, like my Employee class? The reason I’m needing to do this, is that when I click on an item in the list, I want to retrieve the actual Employee object that I used for that item and then retrieve the ID of the employee so I can display information pertaining to that Employee.

I’m a little bit confused on how to use Adapters properly. Should I make my own adapter or something?

  • 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-05-25T20:44:27+00:00Added an answer on May 25, 2026 at 8:44 pm

    You’ll need to implement your custom adapter. Ex:

    class CustomAdapter extends ArrayAdapter<Employee>
    

    and when use it on SeparatedListAdapter:

    CustomAdapter workersAdapter = new CustomAdapter(this, resourceID, workersList);
    SeparatedListAdapter separated = new SeparatedListAdapter(this);
    ...
    separated.addSection("Workers", workersAdapter);
    

    Edit:
    Overrride getView Method in your CustomAdapter to create views with Employee info. Like this:

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View view;
            if(convertView == null){
                view = convertView;
            }else
                view = mInflater.inflate(R.layout.your_row, null);
    
            Employee e = getItem(position);
    
            ((TextView)view.findViewById(R.id.textview_id)).setText(e.getId());
            //...
    
            return view;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic XML object that I'm working with. I can't figure out
I have an simple custom object called MyObject (a couple of basic properties and
I have a basic domain object, say like Person or Campaign or Event that
I have a basic Customer/Order/OrderItem/Product object graph. Customer has Many Orders, Order has Many
I have a basic form with controls that are databound to an object implementing
I have the current basic structure for each domain object that I need to
I have a Property Grid in C#, loading up a 'PropertyAdapter' object (a basic
I have a basic Rails model with two properties, name and code . I
I have a NSStatusItem called statusItem created in my AppDelegate. I want to change
I have a basic core interface called IComponent. public interface IComponent { void Initialize();

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.