I have three concurrent AsyncTask instances for uploading three files. When two concrete ones end, in the end onPostExecute()I check the flag set by each, and if both of them are true, I call startActivity()for the next action.
Currently, I see activity called twice, or something similar to this type of behavior. Since the screen makes this βtransitionalβ transition to the next action, it sometimes does it twice (and when I hit back, it returns to the same activity). Obviously, two versions of an activity that MUST only be called once are pushed onto the activity stack.
Could it be both running onPostExecute () s and checking each other's flags at the same time? This seems extremely unlikely since the two processes must be executed in turn in parallel ...
***** EDIT *** Much has been removed from this question, since I was away from what I thought was wrong. However, I found the answer very useful here, so I edited the question to reflect the useful parts.
source
share