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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:59:03+00:00 2026-06-06T07:59:03+00:00

I am putting class objects in a spinner view and can display them but

  • 0

I am putting class objects in a spinner view and can display them but what’s displaying is the full qualified class name of something like: wxyg.dash1.object.abc.adb93931. In my class I have the following properties; gridNickName, gridName, firstName, lastName, password, and loginURI. Is there some property I can set so what is DISPLAYED in the spinner view is one of these properties? The whole class object still needs to be in the list though. Do I have to adjust my adapter or something? The is what I have briefly.

        //getting arrays from strings file
    String[] regions;
    Spinner gridSpinner;
    Spinner regionSpinner;

    ArrayList <Grid> al = new ArrayList<Grid>();
       Grid Grid1 = new Grid("meet grid1", "GridHB5", "pqppq", "wdwd","wdwdww", "www.google.com");
       Grid Grid2 = new Grid("meet grid2", "GridHB6", "zzz", "uuu", "secret1","www.ebay.com");
       Grid Grid3 = new Grid("meet grid3", "GridHB7", "xxx", "dskd", "secret3","www.amazon.com");
       Grid Grid4 = new Grid("meet grid4", "GridHB8", "qqq", "dsdsd", "secret4","www.me.com");

protected void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView (R.layout.activity_f1);
    setTitleFromActivityLabel (R.id.title_text);

    //declaring variables

    al.add(Grid1);
    al.add(Grid2);
    al.add(Grid3);
    al.add(Grid4);


    Button submitButton = (Button) findViewById(R.id.button1);
    Button cancelButton = (Button) findViewById(R.id.button2);

    //getting arrays from strings file
    regions = getResources().getStringArray(R.array.regions_array);
  //  grids = getResources().getStringArray(R.array.grids_array);

    this.gridSpinner = (Spinner) findViewById(R.id.gridSpinner);
    this.regionSpinner = (Spinner) findViewById(R.id.regionSpinner);

    //creating adapters for both spinners

    final ArrayAdapter<Grid> dataAdapter  = new ArrayAdapter<Grid>(this, android.R.layout.simple_spinner_item, al);
    ArrayAdapter<String> regionAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, regions);

    // drop down layout style with radio button type.

    dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    regionAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    // attaching data adapters to spinners
    gridSpinner.setAdapter(dataAdapter);
    regionSpinner.setAdapter(regionAdapter);

As always I really appreciate you guys looking at this for me. I’m sure this is an easy fix and there is probably a property I am not aware of.

Thanks again!

  • 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-06T07:59:05+00:00Added an answer on June 6, 2026 at 7:59 am

    Define your own toString() method in your Grid class.

    public String toString() {
        return gridName; // or gridNickName + lastName; Whatever you want
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm putting together a custom SynchronizedCollection<T> class so that I can have a synchronized
In my Django project I am using Product.objects.all().order_by('order') in a view, but it doesn't
When putting a favicon on your site, you can apparently use an animated gif,
I putting together a page that will display a set of stored values. I
UPDATE:: OK i am putting the original problem statement here Given the Main class
I have 2 models in my Django code: class ModelA(models.Model): name = models.CharField(max_length=255) description
Without thinking about it too much, I've been doing something like the following: 1)
I am creating 3 objects of same class: A,B,rB. Here rB is referencing to
I have a Rails form for editing objects of a particular class. The labels
When the following class is serialized with a BinaryFormatter , any objects subscribing to

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.