i got a problem with json array data, i have tried the following code using that i can get the json response perfectly but in listview i am getting single data even in response also i am getting single item why?
here is the code:
URL = "some url";
HttpClient mHttpClient = new DefaultHttpClient();
HttpGet mGetMethod = new HttpGet(URL);
HttpResponse mReponseMessage = mHttpClient.execute(mGetMethod);
String Response = EntityUtils.toString(mReponseMessage.getEntity());
Log.d("TAG", "O/P Response is " + Response);
JSONArray responseObject = new JSONArray(Response);
System.out.println("responseObject="+responseObject);
for(int i=0; i<responseObject.length(); i++) {
obj = responseObject.getJSONObject(i);
}
here is my json response
[{"dmessage":"sfsfs","message":"sfsf","mp3":"Kalimba.mp3","user_message_id":"85","category":"Lottery","title":"dgfs"},{"dmessage":"prueba","message":"prueba","mp3":"NA","user_message_id":"80","category":"Lottery","title":"prueba"},{"dmessage":"prueba","message":"prueba","mp3":"NA","user_message_id":"79","category":"Lottery","title":"prueba"},
Here obj is response object,in response object also i am getting the single value
Could anybody help me to solve the issue Thanks!