I have an array and this array has another array inside.
I need to obtain the data inside this other array.
This is the code that I use to get all the array items, but I am not sure how to get the other array elements that are stored at index(0)
.
if (msg.equals("warning")) {
List<String> dataWarn = (ArrayList<String>) data;
Log.i("api", dataWarn.toString());
}
I think you're almost there. Just get the first element from the list twice:
if (msg.equals("warning")) {
List<String> dataWarn = (List<String>) data;
List<String> dataWatnItem0 = (List<String>) dataWarn.get(0);
Log.i("api", dataWatnItem0.get(0).toString());
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.