0

App launch behavior makes me complicated! After my app is overwritten to be upgraded while it is running, re-launching behavior is something wrong.

Normally it displays last activity running when I click its icon to resume since it was stopped by home key. This does as I expected and all activities are called in standard launchMode.

No problem there, but here is the problem. If I run the same apk to re-install or upgrade it while it is still running then the app always launches with the activity A that has android.intent.category.LAUNCHER property, does not display last activity B until I kill the app on the task manager and start it again.

I don't get this behavior, and I'm not sure the same issue will be occur when it is upgraded by play store.

The sequence to meet the situation I found is following

  1. install App (App should have at least 2 activities, one as a launcher, the other to move)
  2. launch app with app icon
  3. LAUNCHER activity A displays
  4. move to activity B
  5. press home key
  6. launch the app with app icon again
  7. App launches with Activity B <----------------------- check point! It's fine.

  8. press home key

  9. install the App again with the same version or higher
  10. launch app with app icon
  11. App launches with Activity A
  12. move to activity B
  13. press home key
  14. launch app with app icon
  15. App launches with Activity A <-------------------------- check point! something wrong.

  16. kill the app

  17. launch app with app icon
  18. App launches with Activity A
  19. move to activity B
  20. press home key
  21. launch app with app icon
  22. App launches with Activity B <-------------------------- check point! the problem has gone.

I think I got some more issues with me for this thing such as a static objects problem. so please let me know why this thing happens.

Thanks.

0 Answers0