Best code examples for Android Spinner class (android.widget.Spinner)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Spinner class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Spinner examples from Open Source projects
Examples using Android Spinner setPrompt method:
This code example shows how to use the following methods: setPrompt, getPrompt
24:	spinner.setPrompt("foo"); 
-
26:	assertThat(spinner.getPrompt().toString()).isEqualTo("foo"); 
Full Snippet Info
7
CodeRank
Examples using Android Spinner setEnabled method:
This code example shows how to use the following methods: setEnabled
56:	spinner.setEnabled(enabled); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEnabled
140:	mInterval.setEnabled(enable); 
Full Snippet Info
6
CodeRank
Examples using Android Spinner setAdapter method:
This code example shows how to use the following methods: setAdapter
346:	Spinner spinner = new Spinner( null ); 
-
348:	spinner.setAdapter( new LookupArrayAdapter<String>( null, lookupList, null ) ); 
349:	assertEquals( "foo", androidWidgetBuilder.getValue( spinner ) ); 
350:	androidWidgetBuilder.setValue( "bar", spinner ); 
351:	assertEquals( "bar", androidWidgetBuilder.getValue( spinner ) ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdapter, getSelectedView
61:	mView.setAdapter(adapter); 
-
78:	View selected = mView.getSelectedView(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: setAdapter, setOnItemSelectedListener
55:	mGroupSpinner.setAdapter(mGroupAdapter); 
56:	mGroupSpinner.setOnItemSelectedListener(this); 
Full Snippet Info
7
CodeRank
Related Android Spinner Questions & Answers:
Other Android Spinner Examples
19:	        // Spinner element
20:	        Spinner spinner = (Spinner) findViewById(R.id.spinner);
21:	
22:	        // Spinner click listener
23:	        spinner.setOnItemSelectedListener(this);
-
19:	        // Spinner element
20:	        Spinner spinner = (Spinner) findViewById(R.id.spinner);
21:	
22:	        // Spinner click listener
23:	        spinner.setOnItemSelectedListener(this);

Read More

2:		private Button btnAddNewCategory;
3:		private TextView txtCategory;
4:		private Spinner spinnerFood;
5:		// array list for spinner adapter
6:		private ArrayList<Category> categoriesList;
-
19:	
20:			btnAddNewCategory = (Button) findViewById(R.id.btnAddNewCategory);
21:			spinnerFood = (Spinner) findViewById(R.id.spinFood);
22:			txtCategory = (TextView) findViewById(R.id.txtCategory);
23:

Read More

19:	
20:		// Spinner element
21:		Spinner spinner;
22:	
23:		// Add button
-
33:	
34:			// Spinner element
35:			spinner = (Spinner) findViewById(R.id.spinner);
36:	
37:			// add button

Read More

1:	Spinner spinner = (Spinner) findViewById(R.id.spinner);
2:	spinner.setOnItemSelectedListener(this);
3:	
-
1:	Spinner spinner = (Spinner) findViewById(R.id.spinner);
2:	spinner.setOnItemSelectedListener(this);
3:

Read More

1:	Spinner spinner = (Spinner) findViewById(R.id.spinner);
2:	// Create an ArrayAdapter using the string array and a default spinner layout
3:	ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
-
1:	Spinner spinner = (Spinner) findViewById(R.id.spinner);
2:	// Create an ArrayAdapter using the string array and a default spinner layout
3:	ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,

Read More

Spinner Class Overview
A view that displays one child at a time and lets the user pick among them. The items in the Spinner come from the A...
Methods
  • setAdapter
    Sets the Adapter used to provide the data which backs this Spinner.
  • setPrompt
    Sets the prompt to display when the dialog is shown.