2016-07-26 19 views
1

よく私はQRコードをスキャンするためにZxingを使用します。それは私のコードです: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); 
      }; 

私の問題は、私がどのように取得し、別の活動でスキャン結果の値を使用することができませんでしたか?

答えて

関連する問題