android - JSON handling Array and object with same Java code -
I have a simple question to apply JSON for Android / Java Is it possible to handle array or object? My Jason is kept in a lot of places in response, where JSON gives a logic and in some cases there are many arguments in an array. To handle, I have to write a long code that if there is an orange or an object in the object, if someone helps me, then how to check if an element contains JSONArray or JSONObject?
Just test ( If you want to avoid duplication, where the array is the array of the examples that you get back in simple case, the first test for non-array, and if you have one, then create an array And paste the single object before passing through its normalized array-handling logic. for example ) the type of object that you want JSON parser To get back from it, see if it's an array, dictionary or an object.
Comments
Post a Comment