I was not able to convert String to JSONArray or JSONObject. Here is the code below:
JSONArray entries = WebRequest.execute(request);
if(entries!=null){
try{
String temp = entries.getJSONObject(0).getString(WebRequest.CONTENT);
String s = temp.toString();
JSONArray cont = new JSONArray(s);
Toast.makeText(getBaseContext(), cont.toString(), Toast.LENGTH_LONG).show();
}catch(Exception e){
}
}
Here is the String result :
"[{\ID_PROJECT\":528,\"NM_PROJECT\":\"TestProject\",,\"NM_TASK\":\"TestTask\"}]"
I was not able to get the toast when using this code.