0

Repro steps:

  1. Run a Launcher implemented in Xamarin.Android in debug mode.
  2. Put a breakpoint on OnDestroy method override.
  3. Open Google Maps. Start the navigation
  4. Press home button which will try to open the launcher ui back up.

As soon as I do that, the breakpoint in OnDestroy hits followed by breakpoint in "OnCreate" and then once more "OnDestroy" followed by "OnCreate".

It is causing the whole launcher to practically restart not only once, but twice.

I even commented out every single piece of code from MainActivity OnCreate to have nothing in there just to make sure that is not my code, but it is still the exact same behavior.

Ideally, I would to see no "OnDestroy" call. Any thoughts...

1 Answers1

0

Found the answer after many trials and errors. Add ConfigChanges.UiMode flag to the ConfigurationChanges attribute for your MainActivity class, and this solves the problem, and Launcher does not restart anymore.