Get Selected Items Text in Spinner in Android

by Sasikumar 2013-12-13 17:30:13

To get selected items text in spinner in android :
Get reference to the spinner as follows
my_spinner= (Spinner)findViewById(R.id.my_spinner);

Get value from the selected item with following code
my_spinner.getSelectedItem().toString();

"getSelectedItem()" function would return the selected object, we should use "toString()" function to get the text of the selected item.

Very Happy
Smile
995
like
0
dislike
0
mail
flag

You must LOGIN to add comments