Results 1 to 2 of 2

Thread: Android Spinner on button click

  1. #1
    Join Date
    Apr 2011
    Posts
    1

    Android Spinner on button click

    New to Android programming. When I click a button it needs to see what the spinner has in it then go to the correct .xml layout. If any one can give me some sample code for this it would be great.
    Robert Chandler

  2. #2
    Join Date
    Mar 2010
    Posts
    372

    Re: Android Spinner on button click

    As requested by you the below is the sample code which will give you the basic idea of creating a spinner in android

    Code:
    String[] items = new String[] {"A", "B", "C"};
    Spinner spinner = (Spinner) findViewById(R.id.mySpinner);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, items);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);

Similar Threads

  1. I want to re-enable the right click button of my mouse.
    By Dhulipala in forum Hardware Peripherals
    Replies: 3
    Last Post: 02-03-2012, 10:36 AM
  2. Right click button is not working in Asus Eee PC 900
    By Marquise in forum Hardware Peripherals
    Replies: 5
    Last Post: 08-08-2011, 10:28 AM
  3. how do I get button click on PHP page?
    By Ramona19 in forum Software Development
    Replies: 7
    Last Post: 20-06-2011, 03:09 AM
  4. left click button behaves like a right one
    By iris_777 in forum Windows Software
    Replies: 2
    Last Post: 02-11-2010, 03:31 AM
  5. To simulate button click in C#
    By SunilKumar in forum Software Development
    Replies: 2
    Last Post: 02-02-2009, 11:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,941,305.71470 seconds with 16 queries