0

In Android, I want to use a custom Spinner that initially (when the user has not made a selection yet) displays the text "Select One". When the user clicks the spinner, the list of items is displayed and the user selects one of the options.

i'm getting my data via webservice in format json and i can put it in a custom spinner. but i always have the first item already selected.

user3921905
  • 129
  • 1
  • 3
  • 11
  • Look at this SO post http://stackoverflow.com/questions/4726490/android-set-spinner-default-value-to-null – JEY Apr 02 '15 at 14:57
  • What do you specifically want to do? you want to select an item from json data for spinner so it wont select the first item n show it in spinner. – Pankaj Apr 02 '15 at 14:58
  • when i get my data from json there is always a first item selected automatically. i want the user to select the first item (like select one item). – user3921905 Apr 02 '15 at 15:03
  • Spinner behavior is the same behavior which you want to do. What more you can do is use a default method for spinner which is spinner.SetSelection(position); which will select one of the item from the json data or arraylist whatever it is. – Pankaj Apr 02 '15 at 15:11
  • @JEY i tried this one but it dosn't work. there is no prompt and not data. just an empty spinner – user3921905 Apr 02 '15 at 16:15

0 Answers0