String value = myInput.getText().toString();
I want to put string value into JSONObject.put("STRING",value) method but it's not working..
See the attached screen shot and tell how to resolve this.

Add try.. catch
String data = "";
String val = "hello";
try {
JSONObject j = new JSONObject(data);
j.put("VAL", val);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With