Unhandled exception type JSONException

anime-tawn

New Member
\[code\]JSONObject login = new JSONObject();login.put("Key1", "Value1");\[/code\]I was just trying to create a simple JSON Object with key and value pairs. I get this exception "\[code\]Unhandled exception type JSONException\[/code\]". \[code\]Map<String,String> map = new HashMap<String,String>map.put("key1", "value1");\[/code\]Are they both equivalent way of creating an object with key, value pair. Which is the preferred way when creating an object which needs to send to a service.
 
Back
Top