Bug 28902 - Android App.MainPage set to many times will crash
Summary: Android App.MainPage set to many times will crash
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-08 17:17 UTC by Mobiledev
Modified: 2015-04-09 13:15 UTC (History)
0 users

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED INVALID

Description Mobiledev 2015-04-08 17:17:42 UTC
When you change the App.MainPage too many times will cause the Android App to crash, the same actions in iOS work just fine.  To Reproduce, simply Create a new ContentPage with a button to create a new ContentPage and set it as the new MainPage (App.MainPage) and unload the current page, then run it.  After clicking the button enough times, creating pages, setting them as the MainPage and then unloading them, the Android app will crash with an unexpected error.  In my case I have an about page and a settings page, each with a single button and to verify this issue, I had the button in settings create and load an About page, and the button in the About page would create and load the Settings page.  After about 6 button clicks, the application crashed.  Maybe the Garbage Collector isn't cleaning up the pages?
Comment 1 Mobiledev 2015-04-09 13:15:40 UTC
It turns out that the issue is not due to switching the main page, but due to ViewCells in listviews causing android to crash.  Please remove this bug as it is a duplicate of existing bugs on this platform.