Skip to content Skip to sidebar Skip to footer

Errors When Getting Json Result Into Listview

UPDATE 4: Problem Solved Check my Answer Below I am trying to retreive JSON result from PHP Webservice and save it into ListView But I got an errors I'm not sure what is my mistak

Solution 1:

The error message Value <!DOCTYPE> of type java.lang.String cannot be converted to JSONObject indicates that you're not getting a JSON response from the server, but a markup document, most probably an error page.

You can either try executing the request outside Android to check whether it's working fine, or you can split your process into two steps:

  1. Get a text response from the web service into String, and Log it.
  2. Parse that String into JSON

That way you will have a log of the response before the parsing fails, so you will have more info.

Solution 2:

Thanks to everyone for your responses

I found the mistake

Actually It's just an error passing a wrong parameter

in fact it's a mistake in the web server that there are should be 2 kind of access token one for Login and the other for the selected event But when I select an event the implementation change the one that comes with login to event access token

previously I was working on specific Event ID without to finish other things related to events that's why I didn't notice the changes

Now Problem Solved

Long story short The Code Is Correct

thank you again

Post a Comment for "Errors When Getting Json Result Into Listview"