MainActivity.cs 841 B

123456789101112131415161718192021222324
  1. using System;
  2. using Android.App;
  3. using Android.Content.PM;
  4. using Avalonia;
  5. using Avalonia.Android;
  6. namespace MobileSandbox.Android
  7. {
  8. [Activity(Label = "MobileSandbox.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
  9. public class MainActivity : AvaloniaMainActivity<App>
  10. {
  11. protected override void OnCreate(Bundle savedInstanceState)
  12. {
  13. AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
  14. base.OnCreate(savedInstanceState);
  15. }
  16. private void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
  17. {
  18. System.Diagnostics.Debug.WriteLine(e.ToString());
  19. }
  20. }
  21. }