public void Connect() { ThreadPool.QueueUserWorkItem(async o => { MobileBarcodeScanner.Initialize(Application); var scanner = new ZXing.Mobile.MobileBarcodeScanner(); var result = await scanner.Scan(); if (result == null) { return; } JObject qr = JObject.Parse(result.Text); WebApp.Connect((string)qr["uuid"], (string)qr["wsUrl"], () => { RunOnUiThread(() => { StartActivity(typeof(Activities.AlbumViewActivity)); }); }); }); }