e.k
e.k

Reputation: 1363

Android how to call and get value from Parse table?

Hi I have to get a value from parse table. Column name is "isAvailable" of boolean type and my class name is "Presence". I'm having user id example usTremn06. I have to call this particular column and return the record for this particular user. I'm new to parse and I don't how to make a call to parse table. Can anybody help me to solve this and thanks in advance.

Upvotes: 0

Views: 246

Answers (2)

Karthik
Karthik

Reputation: 381

try this if you have user means user.get(column name);

Upvotes: 1

Mr.7
Mr.7

Reputation: 2713

Try Somthing like this

ParseQuery <ParseObject> query = ParseQuery.getQuery("Presence");
query.whereEqualTo("userId", userId); // userId = 'Tremn06'
query.findInBackground(new FindCallback <ParseObject> () {@
    Override
    public void done(List <ParseObject> objects, com.parse.ParseException e) {
        if (e == null) {
            for (ParseObject parseObject: objects) {
                boolean isAvail = parseObject.get("isAvailable");
            }
        } else {
            // Something went wrong.
            Toast.makeText(getActivity(), "Error: " + e.getMessage().toString(), Toast.LENGTH_SHORT).show();
        }
    }
});

Upvotes: 1

Related Questions