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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:33:56+00:00 2026-06-07T02:33:56+00:00

I am developing this app and one of an activity has two spinners, and

  • 0

I am developing this app and one of an activity has two spinners, and both loads same entries, even I defined different entries for each Spinner. This is rather weird thing.

Here is the code,

main.xml layout(part 0f layout)

<TableRow
        android:id="@+id/settings_color_row"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp" >

        <TextView
            android:id="@+id/settings_color_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_span="0"
            android:gravity="left"
            android:paddingLeft="7dp"
            android:paddingTop="13dp"
            android:text="Color"
            android:textSize="18dp"
            android:textStyle="bold"
            android:typeface="serif" >
        </TextView>

        <Spinner
            android:id="@+id/settings_color_spinner"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"

             />
    </TableRow>

    <TableRow
        android:id="@+id/settings_background_row"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp" >

        <TextView
            android:id="@+id/settings_background_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_span="0"
            android:gravity="left"
            android:paddingLeft="7dp"
            android:paddingTop="13dp"
            android:text="Skin"
            android:textSize="18dp"
            android:textStyle="bold"
            android:typeface="serif" >
        </TextView>

        <Spinner
            android:id="@+id/settings_background_spinner"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"

             />
    </TableRow>

Settings.java (Activity)

    colors_spinner = (Spinner)findViewById(R.id.settings_color_spinner);
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
            R.array.colors_array, android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    colors_spinner.setAdapter(adapter);

    skin_spinner = (Spinner)findViewById(R.id.settings_background_spinner);
    ArrayAdapter<CharSequence> skin_adapter = ArrayAdapter.createFromResource(this,
            R.array.background_array, android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    skin_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    colors_spinner.setAdapter(skin_adapter);

strings.xml

 <?xml version="1.0" encoding="utf-8"?>
 <resources>

<string name="hello">Hello World, Settings!</string>
<string name="app_name">Shared Preferences Test</string>

<string-array name="colors_array">
    <item>White</item>
    <item>Red</item>
    <item>Blue</item>
    <item>Pink</item>
</string-array>

<string-array name="background_array">
    <item>Red-Nosed Reindeer</item>
    <item>Snowman</item>
</string-array>

</resources>

I don’t see any errors and it just show same values even though I used different adapters.

enter image description here

  • 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-07T02:33:58+00:00Added an answer on June 7, 2026 at 2:33 am

    Try changing the last line of this:

    skin_spinner = (Spinner)findViewById(R.id.settings_background_spinner);
    ArrayAdapter<CharSequence> skin_adapter = ArrayAdapter.createFromResource(this,
            R.array.background_array, android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    skin_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    colors_spinner.setAdapter(skin_adapter);
    

    to this:

    skin_spinner.setAdapter(skin_adapter); // not colors_spinner
    

    I believe you just didn’t notice that you are setting skin_adapter to the wrong Spinner after a cut & paste.

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

Sidebar

Related Questions

We're developing this ASP.NET web app with multiple users on different browsers. One of
I am developing an ipad app.In this app,I have two sections-one showing a Gallery
I am developing an android app which has a button in one activity and
This question actually has two parts. The first part: I've been developing my first
I am developing an app widget that starts one activity which changes layout of
i am developing one application in android ,in this app related to themes. select
I am developing an Android app, this app has a dozen of Activities, each
I am very new to android and I am developing this app which allows
I am developing a web app and in this app I sometimes load content
I have been putting off developing this part of my app for sometime purely

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.