I'm having a very confusing issue. I have built a final release APK of my app, submitted it to the Play Store, and installed on my test device. The application has exhibits different launch mode behavior when I install it this way.
My generated APK is the product of a Gradle build going though both Proguard and zipalign. For ease of explanation, say my app is a dashboard type app whose main Activity shows a launch button for activity B. I took this release APK and installed it to my device via USB 'adb install ' so I'm comparing the exact same APK with two different methods of install.
USB Method: When a user clicks on the button in the main activity to launch Activity B, Activity B is launched and shows on screen. If the user hits the home button (gets a call etc) then comes back to the app, Activity B is still showing. This is the desired (AND EXPECTED) behavior.
Store Method: Downloading the APK from the store and installing/launching again shows the main Activity. When the button is clicked, Activity B is again launched. Now, when the user hits home and comes back, the back stack is apparently cleared and the main Activity is shown again.
I do not specify any special launch modes in the manifest so all activities are standard. How could the method of installation affect such a thing!? This is driving me mad. Does anyone have any idea of why this might be happening?