Find your content:

Search form

You are here

conversion from string to json object android

 
Share

Below code works

 

	String json = "{\"word\":\"hello\"}";
try {
        JSONObject obj = new JSONObject(json);
        Log.d("phonetype value ", obj.getString("word"));

    } catch (Throwable tx) {
        Log.e("My App", "Could not parse malformed JSON: \"" + json + "\"");
    }

My Block Status

My Block Content