Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Handling Unhandled exception for Android still crashes app?

$
0
0

I have in MainActivity handling undhandled exceptions as below but even though doing this causing app to crash. Is there a way to handle that app is not crashing?

 protected override void OnCreate(Bundle bundle)
        {

            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            System.Threading.Tasks.TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;
            AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironmentOnUnhandledException;

using below in UWP works fine. not crashing the app.

  UnhandledException += async (sender, e) =>
            {
                e.Handled = true;   

            };

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>