Google Developers Group
public void barcode(){Log.i("mssg", "Barcode Button pressed");Intent intent = new Intent("com.google.zxing.client.android.SCAN");intent.putExtra("SCAN_MODE", "Product_MODE");// Product_MODE or QR_CODE_MODEstartActivityForResult(intent, 0);}// handle info from resultpublic void onActivityResult(int requestCode, int resultCode, Intent intent) {if (requestCode == 0) {if (resultCode == RESULT_OK) {String contents = intent.getStringExtra("SCAN_RESULT");// Barcode number or QR code infoString format = intent.getStringExtra("SCAN_RESULT_FORMAT");// do things with info gathered} else if (resultCode == RESULT_CANCELED) {// Handle cancel}}
© 2013 Created by Uki Dominque Lucas.
You need to be a member of GDG Chicago Android to add comments!
Join GDG Chicago Android