Moin Khan Moin Khan - 7 months ago 35
Android Question

How to get value from selected spinner item from json?

I am getting selected spinner value response like below -

{cCodeName=abc, nSerialNo=1}

How can i get "1" from "nSerialNo" in variable ?


you need to parse json like below:

String response={cCodeName=abc, nSerialNo=1};
JsonObject obj=new JsonObject(response);
String serialNo=obj.getString("nSerialNo");

in serialNo you get value of your spinner