I am getting this error on parsing json. Can anyone help me to solve this.
{
"website": [
"http://www.example.com",
"https://buy.example.com"
],
"number": [
"4546",
"54256456"
],
"email": [
"[email protected]",
"[email protected]"
],
"address": [
"any adddress here",
"Address 2"
]
}
Anyone help me to how exactly parse this json...
Json Parsing code
String JSON_STRING = response.body().string();
Log.e("json_string", JSON_STRING.toString());
//Toast.makeText( getApplicationContext(), "Response : "+JSON_STRING, Toast.LENGTH_LONG ).show();
JSONObject object = new JSONObject( JSON_STRING );
JSONArray jsonArray = object.getJSONArray( "website" );
for (int i=0; i<jsonArray.length(); i++)
{
JSONObject website = jsonArray.getJSONObject( i );
Log.e("website", website.toString());
}