Is it Possible I can create a spinner with options and values.
<select name=test>
<option value="1">Baran</option>
<option value="2">Khan</option>
</select>
with the spinner XML:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="test">
<item Value="1">Baran</item>
<item value="2">Khan</item>
</string-array>
</resources>
How can I accomplish such target. As I need to pass Ids to the Server.
You have to manage two list and both are dynamic as you want.
Step to achieve :
CreatetwoArrayList<String>.Depend on your data type here i make as String Array.Add valueto ArrayList.Create custom adapterand pass two list adapter in that and get value according that.Add listto Spinner Adapter. Get the index or position ofthe Spinner.
same index to get value from second list value.Send that value to server.See Demo Example that will Guide you to make easy.
Enjoy !!!