Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I ran a simple test:
1. Create a fresh Mono for Android project. Add a second activity, and make the button of the default activity launch the second activity.
2. Make an identical app in Eclipse using pure Java.
3. Launch the Java app, tap the button to go to the second activity. Now press Home, then re-launch the app. Note that the app comes up on the second activity.
4. Launch the Mono for Android app, tap the button to go to the second activity. Now press Home, then re-launch the app. The app comes up on the first activity.
How can Mono for Android apps resume where they left off like Java apps do?
This repros 100% of the time for me. I'm testing with a Nexus One running Android 2.3.6.
Created attachment 1044 [details]
Attached is a trivial sample project.
I was able to reproduce the issue with the attached project ~2 weeks ago, but now I am not. I suspect that 4.0.1 fixed it, but I have no idea how/why.
(I can now commence tearing out what's left of my hair.)
Mark as Fixed as I can't repro with 4.0.1.
I could still reproduce this with Nexus 7 (4.1) and Galaxy Note (2.3.6).
I found some differentiator. When I launch MfA app from (default) launcher, the Activity transition is the same as Eclipse runs it. But if I do it with am:
adb -e shell am start -a android.intent.action.MAIN Scratch.MultiActivity/scratch.multiactivity.Activity1
It results in the issue described here (and that's what we do in MonoDevelop, maybe as well as VS).
monodevelop addin got the fix. VS to wait (but should not take long, just it needs to include tools fix).
It should be included in VS too.
So if I understand this correctly, the fix is to add `-c android.intent.category.LAUNCHER`:
adb shell am start -a android.intent.action.MAIN \
-c android.intent.category.LAUNCHER \
I wonder why this is required...
That would explain why I couldn't repro, though, as I was usually manually launching from the Home screen, not from MonoDevelop...
I don't understand why it gives different result, but I found it from ADT source: