Skip to content Skip to sidebar Skip to footer

Com.android.volley.parse Error Org.json.jsonexception Value Of Type Java.lang.string Cannot Be Converted To Jsonarray In Android Volley

When I run this program I get this error . I don't know how to solve . Help me finding it Please. This is my json_encode php code api. $i=0; while ($row = $result->fetch_ass

Solution 1:

Content Type

<?PHP
header('Content-Type: application/json');

See Returning JSON from a PHP script.

Byte Order Marker

PHP is prone to return a BOM at the beginning of the response, when the .php file or any of its includes have UTF-8 character encoding.

For more information, see this W3C answer and section UTF-8 BOM in this post.

One suggested way to prevent PHP from prepending a BOM is to change the character set of your php file(s) from UTF-8 to ASCII or ISO-8859-15.

Solution 2:

The response you are getting is a string and you are trying to assing it to jsonArray

Post a Comment for "Com.android.volley.parse Error Org.json.jsonexception Value Of Type Java.lang.string Cannot Be Converted To Jsonarray In Android Volley"