I am new to android
development. I am stuck try to show dropdown's data into android . Data will come from server as a json
format. I am using volley
library for HTTP
requests. Here is my volley
response
{"blood_group_map":[{"value":"1","text":"O+"},{"value":"2","text":"O-"},{"value":"3","text":"A+"},{"value":"4","text":"A-"},{"value":"5","text":"B+"},{"value":"6","text":"B-"},{"value":"7","text":"AB+"},{"value":"8","text":"AB-"}]}
In this response
I want draw blood_group_map
key in Spinner
option list like this HTML
. Here value
key is used for value and text
key is used for display text.
<option value="1">O+</option>
Update:
I parsed this JSON but I want to send spiner value property to server and display text property. How can I send value to server not text ?
For Example if I select O+ blood group then I send spinner value 1 to server.