Android: Options on Spinner based on which button clicked
<p>so I have this layout with buttons A &amp; B and a spinner under them.
The A &amp; B buttons work like radio buttons.
I wanna 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 &amp; 2 as the options.</p>

<p>Can anybody help me with that?</p>

<p>Thanks much.</p>

<p>Code:</p>

<pre><code> public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.create_game);

        Spinner spinner_player = (Spinner) findViewById(R.id.spinner_player);
        ArrayAdapter&lt;CharSequence&gt; 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);

    }
</code></pre>
