Android Spinner - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Spinner class.

This code example shows how to use the following methods: getBottom, getLeft, getRight
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getPrompt, setPrompt
        spinner = new Spinner(new Activity());
    } 
 
    @Test 
    public void testPrompt() { 
        spinner.setPrompt("foo");
 
        assertThat(spinner.getPrompt().toString()).isEqualTo("foo");
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getBottom, getLeft, getRight
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setEnabled
	public void setModifiable(boolean enabled) {
		if(enabled)
			button.setVisibility(VISIBLE);
		else 
			button.setVisibility(INVISIBLE);
		spinner.setEnabled(enabled);
	} 
	 
	public void setLast() { 
		selectionExtra = ":";
	} 
	 
	public String getSelection() {
		return spinner.getSelectedItem().toString() + selectionExtra;
	} 
	 
	private void remove() { 
		if(parentView != null)
			parentView.removeView(this);
		if(tagsFragment != null)
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
    @Before 
    public void setUp() throws Exception { 
        context = new Activity();
        adapterView = new Gallery(context);
		spinner = new Spinner(context);
		shadowSpinner = (ShadowAbsSpinner) Robolectric.shadowOf(spinner);
		String [] testItems = {"foo", "bar"};
		arrayAdapter = new MyArrayAdapter(this.context, testItems);
    } 
 
    @Test 
    public void shouldHaveAdapterViewCommonBehavior() throws Exception { 
        AdapterViewBehavior.shouldActAsAdapterView(adapterView);
    } 
 
	@Test 
	public void checkSetAdapter() { 
		spinner.setAdapter(arrayAdapter);
	} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

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

See Code Examples for Android Spinner Methods: