protected override void OnCreate(Bundle savedInstanceState) { AppInstrumentation.ApplicationCreateBegin(this); AppInstrumentation.OnActivityCreateBegin(this.GetType().Name); base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); //Enable ANR Monitor APMS.Instance.EnableAnrMonitor(true); //Init views btnNetwork = FindViewById <Button>(Resource.Id.btnNetworkrequest); btnCustomNormalEvent = FindViewById <Button>(Resource.Id.btnCustomEvent); btnCustomNetworkEvent = FindViewById <Button>(Resource.Id.btnCustomNetworkEvent); btnOpenAnrActivity = FindViewById <Button>(Resource.Id.btnOpenAnrActivity); btnOpenSecondActivity = FindViewById <Button>(Resource.Id.btnOpenSecondActivity); swiEnableApms = FindViewById <Switch>(Resource.Id.swiEnableCollection); //Events btnNetwork.Click += BtnNetwork_Click; btnCustomNormalEvent.Click += BtnCustomNormalEvent_Click; btnCustomNetworkEvent.Click += BtnCustomNetworkEvent_Click; btnOpenAnrActivity.Click += BtnOpenAnrActivity_Click; btnOpenSecondActivity.Click += BtnOpenSecondActivity_Click; swiEnableApms.CheckedChange += SwiEnableApms_CheckedChange; AppInstrumentation.OnActivityCreateEnd(); AppInstrumentation.ApplicationCreateEnd(); }
protected override void OnRestart() { AppInstrumentation.OnActivityRestartBegin(this.GetType().Name); base.OnResume(); AppInstrumentation.OnActivityRestartEnd(); }
protected override void AttachBaseContext(Context context) { AppInstrumentation.AttachBaseContextBegin(context); base.AttachBaseContext(context); AppInstrumentation.AttachBaseContextEnd(); }