json - JSONParser doesn't work in Android -


this type of json object coming android device :

{"successful":true,"value":{"materials":[{"materialid":999999,"type":1,"stockno":1,"weight":1}]}}

i'm trying parse :

public string parsematerial(jsonobject object){ try{     jsonarray objectarray = object.getjsonarray("value");     } catch(jsonexception e){     log.d("jsonparser=>error", e.getmessage());     } } 

what in logcat :

d/jsonparser=>error: value:{"materials":[{"materialid":999999,"type":1,"stockno":1,"weight":1}]}

what doing wrong here? why program fall in catch block? thanks.

cause value not json array


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -