Here's another fun Android / PackageManager behavior - Android doesn't kill an app before upgrading it (unlike on iOS). You may think this is a feature, except that after the upgrade the PackageManager is now out-of-sync with the running code. So for example, say v1 of the code is still running after an upgrade to v2, and the code calls getPackageInfo() in order to find out say, its versionCode. The running code will erroneously think it's v2.
https://github.com/yahoo/ygloo-ymagine/blob/master/src/com/y...
Here's another fun Android / PackageManager behavior - Android doesn't kill an app before upgrading it (unlike on iOS). You may think this is a feature, except that after the upgrade the PackageManager is now out-of-sync with the running code. So for example, say v1 of the code is still running after an upgrade to v2, and the code calls getPackageInfo() in order to find out say, its versionCode. The running code will erroneously think it's v2.