3

I'm trying to retrieve an entire array that is stored in parse. I know how to retrieve int, strings but I dont know how to retrieve an array. I've used .get() but i dont know how to do it. Do I have to create an ArrayList? A List ?

//Inside the query
ArrayList<String> list= new ArrayList<String>;
list=object.get("array");

If you can provide an example please.

4

3 回答 3

4

你可以使用:

list.addAll(object.getList("array"));

Parse 提供的API Reference非常有用。

于 2013-12-10T10:40:56.853 回答
1

这正是 getJSONArray() 的用途。

例如:

 ArrayList<String> list= new ArrayList<String>;
 list=object.getJSONArray("arrayName");

文档

于 2013-10-15T18:37:08.577 回答
0

我使用了以下代码:

List<String> list = new ArrayList<>();

// In ParseQuery //
list = (ArrayList<String>)object.get("ColumnName");

我希望这有帮助

于 2017-01-12T07:28:01.237 回答