protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += FabOnClick; _camhandler = new MyCameraHandler(this); _timerhandler = new Handler(this.MainLooper); _mytimer = new Runnable(() => { if (this.IsDestroyed) { return; } try { _camhandler.TakePhoto(); _timerhandler.PostDelayed(_mytimer, 5000); } catch (System.Exception e) { _camhandler.OnError("MainLoop: " + e.Message); } }); _timerhandler.PostDelayed(_mytimer, 1000); }
public override void OnConfigureFailed(CameraCaptureSession session) { _owner.OnError("Session Configuration failed"); }
public override void OnCaptureFailed(CameraCaptureSession session, CaptureRequest request, CaptureFailure failure) { _owner.OnError("Capture Failed: " + failure.ToString()); }
public override void OnDisconnected(CameraDevice camera) { _owner.OnError("Camera Device disconnected"); }