2016-07-26 48 views
1

我用Zxing掃描QR碼。這是我的代碼爲:如何獲取在另一活動中掃描的QR碼的內容?

public class ScanActivity : Activity 
    { 
     public ZXing.Result scanningResult; 

     protected override void OnCreate(Bundle savedInstanceState) 
     { 
      base.OnCreate(savedInstanceState); 

      // Create your application here 
      SetContentView(Resource.Layout.activity_scan); 
      mReturnValue = new Intent(); 
      Button scanBtn = FindViewById<Button>(Resource.Id.button_scan); 

      MobileBarcodeScanner.Initialize(Application); 
      scanBtn.Click += async (sender, e) => 
      { 
       var scanner = new ZXing.Mobile.MobileBarcodeScanner(); 
       scanningResult = await scanner.Scan(); 

      //  if (scanningResult != null) 
      //   Console.WriteLine("Scanned Barcode: " + scanningResult.Text); 
      }; 

我的問題是,我無法找到如何獲得和使用掃描結果的值在另一個活動?

回答