Android : Delete in background not working when trying to delete the data created by other users in android

on Wednesday, August 6, 2014


"com.parse.parseException object not found for delete" this is the exception. and this is my code



ParseQuery<ParseObject> query = ParseQuery
.getQuery(tableName);
String obID = imgData.get(x).objectID; // Table name and object id are correctly retreived
query.whereEqualTo("objectId", obID);

query.getFirstInBackground(new GetCallback<ParseObject>() {

@Override
public void done(ParseObject object, ParseException e) {
if (e == null) {
// Success
// Parse.Cloud.useMasterKey();
Toast.makeText(activity, tableName,
Toast.LENGTH_SHORT).show();
object.deleteInBackground(new DeleteCallback() {
public void done(ParseException e) {
if (e == null) {
Toast.makeText(activity,
" deleted",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(activity,
e + " not deleted",
Toast.LENGTH_LONG).show();
e.printStackTrace();
Log.d("", e + "");
}
}
});

} else {
}
}
});


when I try to delete the data of the current user it successfully deletes. all read and write permissions in data browser are public.


Although I am googling from 12 hrs but not found the correct solution


0 comments:

Post a Comment