Reputation: 1363
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
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