2

I have a column in my Parse class which is of type Array, as the image below shows:

enter image description here

It is an ArrayList of Strings that I stored before. I want to retrieve that array into my another activity in my Android application. I'm not quite sure how to go about doing this. Currently, my approach is to make a class that extends the ParseObject class and then make a getter method to retrieve it, as follows:

import com.parse.ParseClassName;
import com.parse.ParseObject;

import java.util.ArrayList;
import java.util.List;


@ParseClassName("Workout")
public class ParseWorkout extends ParseObject{

    public ArrayList<String> getReps() {
        return get("Reps");
    }
}

However, its giving me this error:

enter image description here

What is the proper way to retrieve the stored Array objects?

1 Answer 1

3

You can use the getList("Reps") method:

@ParseClassName("Workout")
public class ParseWorkout extends ParseObject{

    public List<String> getReps() {
        return getList("Reps");
    }
}

API Reference (moved): http://parseplatform.org/Parse-SDK-Android/api/com/parse/ParseObject.html#getList(java.lang.String)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.