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.
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
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);
Bookmarks