0

I am trying to handle the case in which, after the user clicks on the "Update" button in the immediate update dialog and the update starts, but he terminates the App. I have tried to get a call back from the onActivityResult as mentioned in the documentation (Here is the link). But this only gives the callback when the user cancels the update in the UI(the cross button) that is shown during the download. In the documentation it is given that we must handle the app termination case as well. How can I achieve this?

Edit: I have tested after terminating the app. The download happens in the background automatically and is showed in the notification tray. But when I cancel this in the tray, it doesn't give me any callback in the onActivityResult.

zombie
  • 33
  • 3

1 Answers1

0

If your app is terminated and it is not running any more, there is no Activity to get the result.

If the user starts the app again, you should go through the usual update check again, and will get the appropriate status, i.e. that an update is in progress or that an update is available.

If one is available, just start it again. There is no need to know that it was previously cancelled - you should be in a fresh state since the app was started anew.

ps. if I misunderstood what you meant when talking about app termination, please point me to the exact place in the documentation that you are worried about handling, as the question was pretty vague.

wojtek.kalicinski
  • 1,081
  • 7
  • 13