Reputation: 307
Say I have an Object Parent
containing Name
as one of the keys. I gotta do a task only after checking if the value say Tom
is available under the key Name
. This is kind of checking for username and password but Parse handles it with inbuilt code.
How do I check for the availability of value for a key in an object in Parse Android?
Any help is appreciated!
Upvotes: 0
Views: 53
Reputation: 66
Try this buddy..
private void checkingKey(){
ParseQuery<ParseObject> lookUp = ParseQuery.getQuery("Parent");
lookUp.whereEqualTo("Name",key);
lookUp.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
if(e==null && list.size()!=0){
//KEY FOUND //
Toast.makeText(getApplicationContext(),list.get(0).get("Name").toString(),Toast.LENGTH_LONG).show();
}else{
//Error fetching Key
}
}
});
}
Upvotes: 1