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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:22:16+00:00 2026-06-10T15:22:16+00:00

I have populated a spinner with some data, like this: adapter = newSpinAdapter(this,com.Orange.R.layout.spinnerrowlist,spinnerInfo); adapter.setDropDownViewResource(com.Orange.R.layout.multiline_spinner_dropdown_item);

  • 0

I have populated a spinner with some data, like this:

adapter =
newSpinAdapter(this,com.Orange.R.layout.spinnerrowlist,spinnerInfo);                  adapter.setDropDownViewResource(com.Orange.R.layout.multiline_spinner_dropdown_item);
previousVisitCommentsSpinner.setAdapter(adapter);

public class UserComments {
    public String coach;
    public String comment;
    public String date;

    public UserComments(String coach, String comment, String date) {
        this.coach = coach;
        this.comment = comment;
        this.date = date;
    }
}

    public class SpinAdapter extends ArrayAdapter<UserComments>{
        private Context context;
        private ArrayList<UserComments> spinnerInfo;

        public SpinAdapter(Context context, int textViewResourceId, ArrayList<UserComments> spinnerInfo){
            super(context, textViewResourceId, spinnerInfo);
            this.spinnerInfo = spinnerInfo;
        }

        @Override
    public View getView(int position, View convertView, ViewGroup parent) {
            View v = convertView;
            if (v == null) {
        LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(R.layout.spinnerrowlist, null);
    }

            Visit.UserComments info = spinnerInfo.get(position);

            if (info != null) {
        TextView spinneritem1 = (TextView) v.findViewById(R.id.textview_spinner1);
        TextView spinneritem2 = (TextView) v.findViewById(R.id.textview_spinner2);
                    TextView spinneritem3 = (TextView) v.findViewById(R.id.textview_spinner3);

        if (spinneritem1 != null) {
                        spinneritem1.setText(info.coach);
                        spinneritem1.setTextColor(getResources().getColor(
                            R.color.medium_gray));
        }

        if (spinneritem2 != null) {
                        spinneritem2.setText(info.comment);
                        spinneritem2.setTextColor(getResources().getColor(
                            R.color.medium_gray));
            }

                    if (spinneritem3 != null) {
                        spinneritem3.setText(info.date);
                        spinneritem3.setTextColor(getResources().getColor(
                            R.color.medium_gray));
            }

        }
            return v;
        }

    }

That is a part of my code. This is how the spinner looks:
here is my picture

This is ok.

But when I click on it I looks like this:
here is my image

It doesn’t show the same data as in the state when it is not selected!!!!
Data that should be displayed when selected should be : 2012-09-03 second 11. Anyone can tell me where I’m going wrong??? and what is the solution. Thx

  • 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-10T15:22:17+00:00Added an answer on June 10, 2026 at 3:22 pm

    You should override toString in your UserComments class, for example:

    public class UserComments {
        public String coach;
        public String comment;
        public String date;
    
        public UserComments(String coach, String comment, String date) {
            this.coach = coach;
            this.comment = comment;
            this.date = date;
        }
    
        @Override
        public String toString() {
            return date + " " + comment + " " + coach;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application, which has a Spinner that I want populated with some
i have an array which is populated in the spinner adapter. now i wanna
I have a Spinner that's populated using a cursor containing data from a database.
I have a spinner widget and I want to populate some data when user
I have a spinner which is populated from the database. This in turn is
I have a spinner witch is populated from database, when I select an item
I have an JPanel populated with several opaque custom components. Now I would like
I have a JTree populated with some (custom) nodes. I have a class that's
I have a UITableView populated by a feed from searchtwitter.com. I also have a
I have created some contacts data in the emulator. When I run the ContactManager

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.