I'm trying delete duplicate installation when reinstall on android. I'm doing get query from ParseInstallation but it is not working.
I attach my code below:
public boolean checkDuplicate(String id, ParseInstallation installation){
ParseQuery<ParseInstallation> query = ParseInstallation.getQuery();
query.whereEqualTo("userId", id);
query.findInBackground(new FindCallback<ParseInstallation>() {
public void done(List<ParseInstallation> list, ParseException e) {
if (e == null) {
//Log.d("LISTA-CHECKDUPLICATE", "id " + list.size() );
for(int i = 0; i<list.size(); i++){
try {
list.get(i).delete();
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
} else {
Log.d("LISTA-CHECKDUPLICATE", "Error: " + e.getMessage());
}
}
});
return false;
}