Created attachment 22005 [details]
Test Project to recreate
If you successfully load/create an activity, any subsequent unhandled exception is confined only to that activity – you get a stopped working dialog, but the previous activity(s) remain functional. However if you put an unhandled exception in the create method of an activity, and handle the exception form the calling activity (from the StartActivity method, not only does it crash the called activity, but it crashes the calling activity. In the example, trying to load activity three, should remain on activity 2, as activity 2 is handling the load of activity 3 with a try/catch, however it returns to activity 1. The ‘crash’ button is just there to confirm the normal operation of an unhandled operation from a fully loaded activity.
Confirmed with the following steps using Visual Studio 2017 15.2 and Xamarin.Android 188.8.131.52:
1. Build and run the attached project.
2. In the Activity 1 screen, tap LOAD ACTIVITY 2.
3. In the Activity 2 screen, tap LOAD ACTIVITY 3.
The last step causes "Unfortunately, ActivityCrashTest has stopped" (Nexus 5, Android 6.0.1).
Here's the relevant snippet from Activity2 OnCreate:
private void LoadActivity3()
//Handle loading an activity, that is at high risk of crashing - activity 3 will have forced exception raised during load.
Intent intent = new Intent(this, typeof(actActivity3));
//NEVER REACHED!! despite exception handled. Crashes this activity, as well as called activity (activity 3).
And here's the Activity3 OnCreate:
protected override void OnCreate(Bundle savedInstanceState)
//Crash the activiy, before it loads
Activity1 continues to run, so you can repeat steps 2, 3 above.
IS anyone actually doing anything with these reports? We take the efforts to demo the bug, it gets confirmed, nine months later, and still nothing....