Reputation: 31
i have integrated Zxing barcode scanner with my application. In my application there is only 1 activity which has 2 textView and a scan button. on clicking scan button i call Zxing to scan barcode. zxing is scanning barcode succesfully but its is not passing the data back to my calling activity. Its scans and shows the result on Zxing activity not on my or calling activity. Can Any1 help me out in this ? Any advice will be very helpfull Thanx in advance
Upvotes: 1
Views: 963
Reputation: 2905
Hope you are using IntentIntegrator and IntentResult class provided by Zxing library to call and get the results . If so then you must add following line in onActivityResult method to get the barcode
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult =
IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
Log.v("barcode", scanResult.getContents().toString());
}
Otherwise please download the IntentIntegrator and IntentResult class and use it.
just you need to call
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.initiateScan();
to initiate the barcode scanning.
Upvotes: 1