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

  • Home
  • SEARCH
  • 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 6606071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:21:25+00:00 2026-05-25T19:21:25+00:00

I have this layout with buttons A & B and a spinner under them.

  • 0

I have this layout with buttons A & B and a spinner under them.
The A & B buttons work like radio buttons. I want to make it, when the user clicks button A, the spinner shows options for example 1,2,3,4 but when the user clicks the button B, the spinner will only give 1 & 2 as the options.

Code:

 public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.create_game);

        Spinner spinner_player = (Spinner) findViewById(R.id.spinner_player);
        ArrayAdapter<CharSequence> a = ArrayAdapter.createFromResource(
                this, R.array.player_array, android.R.layout.simple_spinner_item);
        a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner_player.setAdapter(a);
        spinner_player.setSelection(1);

        ((RadioButton)findViewById(R.id.radio_sudoku)).setChecked(true);

    }
  • 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-25T19:21:26+00:00Added an answer on May 25, 2026 at 7:21 pm

    You set spinner’s contents in code, so nothing prevents you from changing them in response to button click. Or just create two spinners and make one hidden, and on button click change visibility of spinners.

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

Sidebar

Related Questions

I have a layout like this Button MapView Button I want the buttons to
I have a layout similar to this: <div id=...><img src=...></div> and would like to
I have a basic website nav layout that looks like this: <li class=folder parent_folder>
I have this layout that works correctly, a relative layout with a text view
I have this big data-entry sort of page, a table kind of layout using
This is different than the simple 2 column layout. I need to have this
Whats the best way to get this layout in CSS? imagine that I have
I have a linear layout with this form <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical
Has anyone run into this problem... In my layout.phtml I have: <head> <?= $this->headTitle('Control
I have different elements in my layout: Buttons, RadioButtons, EditText, a ListView and I

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.