I’m wondering if there’s a setText() method in spinners? What I want to do is display the selected item in a spinner (it’s saved via sharedpreferences.) so the next time, the user displays the saved data, it should display in the spinner. How can I do that? I already know how to do it an edittext like this : age.setText(age);
But wondering how to show it in spinners.
I’m wondering if there’s a setText() method in spinners ? What I want to
Share
There is no such method in
Spinnerclass.You need to implement a
SpinnerAdapterwhich will be responsible for creating the items of theSpinnerand attach it via thesetAdapter()method.The official Spinners guide may help you: http://developer.android.com/guide/topics/ui/controls/spinner.html