java - Pass a String parameter as a non-array? -



java - Pass a String parameter as a non-array? -

i'm passing string parameter java function wrote.

when pass string parameter method accepting parameter follows http://mywebsite.com/getcity.php?stateid={"state":"alabama"}

i want method take string parameter follows http://mywebsite.com/getcity.php?stateid=alabama

how rid of {"state":"alabama"}?

hey guys,

i'm building android app. syntax below java. i'm going show i'm having trouble. i'm having problem on first line of method show entire method silly.

public jsonarray getdetails(string stateid) { // log.e showing {"state":"alabama"} // how show alabama? log.e("stateid= " + " = ", stateid); }

you've got json object there (and should url encoded if it's going live on url that).

treat json object , utilize jsonobject decode it. deal checked exception thrown see fit.

jsonobject jsonobject = new jsonobject(stateid); system.out.println(jsonobject.getstring("state"));

java

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -