Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

#if DEBUG
            Config.EnableDebugBuild();
#else
            if (Config.IsConfigForReleaseBuildValid() == false)
            {
                DeviceCrashReportAndroid.sendMail(new Throwable("Release build: Config check not passed"),
                                                  ApplicationContext.Resources.GetString(Resource.String.applicationName),
                                                  ApplicationContext.Resources.GetString(Resource.String.contactMail));
            }
#endif

            DeviceDebugAndroid.LogToFileMethodStatic();

            // init xamarin.forms framework in a new backgound task, splash stays on screen
            Task task = new Task
                        (
                delegate
            {
                Forms.Init(this, savedInstanceState);
                OxyPlot.Xamarin.Forms.Platform.Android.Forms.Init();
            }
                        );

            task.Start();
        }
Ejemplo n.º 2
0
        public void UncaughtException(Thread thread, Throwable ex)
        {
         #if false
            Intent intent = new Intent(Forms.Context, typeof(ActivityCrash));
            intent.SetFlags(ActivityFlags.NewTask);            // required when starting from application
            intent.SetFlags(ActivityFlags.DebugLogResolution); // required when starting from application
            intent.PutExtra("text", GetExceptionString(ex));
            Android.Util.Log.Debug("     ****       ", "startung intent");
            //StartActivity(intent);
            Forms.Context.StartActivity(intent);
            Android.Util.Log.Debug("     ****       ", "intent started");
         #else
            DeviceCrashReportAndroid.sendMail(ex, GetContactMail(), GetApplicationName());
         #endif

            // kill this activity
            Finish();
        }