Skip to content Skip to sidebar Skip to footer

How To Get Spinner Value Without Tag

I'm using the spinner, and I want to get the text selected for the user so I'm using String datacat = categorySpinner.getSelectedItem().toString() the problem is that this senten

Solution 1:

Assuming selectedview is EditText.

Stringdatacat=((EditText) categorySpinner.getSelectedView()).getText().toString();

Solution 2:

try

Stringdatacat= categorySpinner.getSelectedView().getText().toString()

you may have to cast the view before you can call getText()

Post a Comment for "How To Get Spinner Value Without Tag"