Is there a way to convert JSON Array to normal Java Array for android ListView data binding?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
we starting from conversion [ JSONArray -> List < JSONObject > ]
next create generic version replacing array.getJSONObject(i++) with POJO
example :
If you don't already have a JSONArray object, call
Then simply loop through that, building your own array. This code assumes it's an array of strings, it shouldn't be hard to modify to suit your particular array structure.
How about using java.util.Arrays?
You can use a
String[]
instead of anArrayList<String>
:Hope it helps!