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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:39:11+00:00 2026-05-26T15:39:11+00:00

I want to populate a spinner with some values from a List The list

  • 0

I want to populate a spinner with some values from a List
The list is populated with objects

    ArrayAdapter<PersonDetails> toStopAdapter = new ArrayAdapter<PersonDetails>(MoreTicketSalesActivity.this, R.layout.generic_spinneritem,
                                R.id.spinner_item_name, personDetails);
    Spinner.setAdapter(toStopAdapter);

My PersonDetails class looks like this

    private int id;
private int index;
private String name;

At the moment when i set the adapter the personDetails is full with data
But on my spinner is displayed some strange text “com.project.person …”

What i do wrong?
Thanks

  • 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-26T15:39:12+00:00Added an answer on May 26, 2026 at 3:39 pm

    You’re using a simple display for each element of the spinner. What does ‘generic_spinneritem’ look like?

    The simple answer is to make sure your PersonDetails class overrides toString and returns the name (or whatever you want). Right now its showing a class name.

    For more complicated row display, you’ll need to create a custom adapter and override getView.

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

Sidebar

Related Questions

I populate a listview from a JSON object. This works fine setListAdapter(new ArrayAdapter<String>(this, R.layout.list_items,
I have an application, which has a Spinner that I want populated with some
I have a spinner set up like this: ArrayAdapter<String> states = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item,
How to get values into the spinner from the DB. I want to display
I have used ArrayAdapter to populate the Spinner. I want to know if it
Hi i have an android spinner populated from and array that i want to
I have a spinner widget and I want to populate some data when user
I have a spinner with items, populated via ArrayAdapter. I want to change font
I want to populate a drop down menu with a column from a MySQL
From the admin panel I want to populate a slug field based on a

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.