简体   繁体   中英

Grabbing an array from Parse

I'm fairly (really) green when it comes to java, and even more so when it comes to android. Anyways, I'm trying to use Parse to get an array and create a table with it, but I can't even figure out how to do anything farther than initialize it.

So. Let's say I want to get an array from Parse with a class name of "data" an object id of "zF3GAgdbi3", and a column id of "stringText". How would I get the array and set an array equal to it (the array being called "stringArray")?

Any help would be appreciated.

This is one way ....

List<ParseObject> results;
ArrayList<String>  wArray = new ArrayList<String>();
final ParseQuery<ParseObject> query1 = new ParseQuery<ParseObject>("data");
        query1.whereEqualTo("zF3GAgdbi3", ParseUser.getCurrentUser().getObjectId());
        try {
            results = query1.find();
            for (ParseObject myData : results) {
                wArray = (ArrayList<String>)myData.get("follow");
                Log.d("Error",wArray.size()+ " ");
            }
            catch (ParseException e) {
            Log.d("Error", e.getMessage());
            e.printStackTrace();
        }

Hopefully this code will work to get array data.....

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM