Skip to content
Advertisement

Tag: object

Loop Object from a single Array

im sending a Json Array from Activity A to Activity B, and i want to populate that Json Array into Spinner in Activity B. but when i Log the json array from Activity A, the data becomes a single object “NVAKSINATOR” : [{“NVAKSINATOR”:”[{“NVAKSINATOR”:”20800″},{“NVAKSINATOR”:”0″},{“NVAKSINATOR”:”77350″},{“NVAKSINATOR”:”51750″},{“NVAKSINATOR”:”30000″},{“NVAKSINATOR”:”51500″},{“NVAKSINATOR”:”25750″},{“NVAKSINATOR”:”30900″}]”}] i want that number like 20800 , 0 , 77350 to be populated in spinner but i

How to access repeated elements in JSON object java?

At first: I know, there are many questions like this one, but all the answers don’t help. I am new to JSON and appreciate every answer. I have a JSON object like this: The JSON object can have hundreds of these elements which begin with “type” : “node”. Now I want to access all lat, lon and names. There are

Converting Class of an Object into a Child Class

Say I have the following classes Then I get an object from an array of Parents If this object is of the child class, I want to cast the tempParent into the child class in order to use “doSomething” without having to create a new object This, however, does not work. I still get an error telling me that doSomething

Advertisement