2012-06-25 41 views

回答

1

您需要在您的活動中致電Zxing intent並放鬆。

首先添加代碼來調用意圖:

IntentIntegrator integrator = new IntentIntegrator(yourActivity); 
integrator.initiateScan(); 

其次,這種添加到您的活動來處理結果:

public void onActivityResult(int requestCode, int resultCode, Intent intent) { 
    IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent); 
    if (scanResult != null) { 
    // handle scan result 
    } 
    // else continue with any other code you need in the method 
    ... 
} 

投資你的時間去通過Zxing.They的wiki頁面已經很好地解釋了它。

http://code.google.com/p/zxing/w/list

http://code.google.com/p/zxing/wiki/ScanningViaIntent

下面是示例應用程序演示如何調用斑馬線意圖。

http://code.google.com/p/zxing/source/browse/trunk/androidtest/src/com/google/zxing/client/androidtest/ZXingTestActivity.java

最後測試項目+圖書館位於

http://code.google.com/p/zxing/source/browse/trunk#trunk%2Fandroid-integration%253Fstate%253Dclosed

+0

是否可以無意掃描條形碼?我想合併zxing代碼和我的應用程序。我如何知道zxing的功能細節? –

+0

Zxing源代碼可在http://code.google.com/p/zxing/source/browse/trunk#trunk%2Fandroid –

+0

您可以告訴我哪一個模塊需要查看一維條碼。 –

相關問題