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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:15:17+00:00 2026-06-12T16:15:17+00:00

I am working on an Android app. I have 2 spinners in a LinearLayout

  • 0

I am working on an Android app. I have 2 spinners in a LinearLayout with a few other EditText. The Spinner on the top shows the radio button with each item in the list. The second one does not and each row in the second Spinner is much thinner than the first Spinner. Here is my xml code.

<Spinner
    android:id="@+id/new_type"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/list_prompt"
android:textColorHint="@android:color/white" />
<Spinner
android:id="@+id/new_course"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/enter_course"
    android:textColorHint="@android:color/white" />

Here is my java code.

Spinner spinner = (Spinner) findViewById(R.id.new_type);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
    R.array.type_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);

Spinner cSpinner = (Spinner) findViewById(R.id.new_course);
ArrayAdapter<CharSequence> cAdapter = ArrayAdapter.createFromResource(this, 
    R.array.course_array, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
cSpinner.setAdapter(cAdapter);

The 2 Spinners are almost identical I cant figure out why there is so much difference between the 2. Any help is greatly appreciated 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-06-12T16:15:18+00:00Added an answer on June 12, 2026 at 4:15 pm

    You are declaring a new ArrayAdapter with the name cAdapter but one line below you are
    setting the drop down view resource to the previous adapter.

    To fix it change this line:

    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    cSpinner.setAdapter(cAdapter);
    

    to

    cAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    cSpinner.setAdapter(cAdapter);
    

    Fixed 🙂

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

Sidebar

Related Questions

Hello I'm working on android app, and I have several radio button on my
Ok so I am working on an android app and I have implanted spinners...
I have an Android app that I had working a few months ago which
I'm working on an android app and here i have few data objects (1000
I am working on a android app and I have an EditText where user
I have only been working with android app development for a few days so
I am working on an android app and have to use remote database for
Working on an Android app with FB 4.6, I would like to have the
I have made an android app which working fine. I implemented the Login functionality
I'm working with an existing Android app and I need to have a dynamically

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.