An issue I was having with my app is that it wasn't resuming to the most recent activity. I added
android:alwaysRetainTaskState="true"
to AndroidManifest.xml. It fixed the issue for debug mode but not when I built for release mode. Kinda.
If I install the app via downloading the release APK to the phone's sdcard and installing from there the mentioned bug exists. If I install the exact same APK via adb the bug does not exist. This is true for both pre and post Android 4.0 devices.
Any ideas? Because I'm so lost.