I have two activites set up, an Inbox and Detail activity. The Inbox activity is just a ListView of messages, and the Detail view is the message itself once clicked on a cell.
Now I am initially passing in the objectID from parse and obtaining the intent data on the second activity just fine. I even constructed the method to delete the message and return to the initial inbox activity:
deleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ParseObject.createWithoutData("User_Messages",
messageObjectId).deleteInBackground(new DeleteCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
finish();
Toast.makeText(getApplicationContext(),
"You have deleted your message", Toast.LENGTH_SHORT).show()
}
}
});
}
});
Now the problem is that sometimes when returned back to the Inbox activity, the message still appears in the ListView even though in the onCreate/onResume of Inbox activity I have the Async task to obtain and set the adapter for the data. Since I have it finish(); in the done portion of parse's block I figure that the Inbox activity will call the async task to obtain / set adapter again, so why would it not be refreshing properly occasionally once users returned back?