There is no concept of surround mode in zzing.
You can, of course, implement the behavior you are looking for, but with zxing inside your application. Use the code that you already have in your question to start scanning for the first time. Add this declaration to your class:
ArrayList<String> results;
Then add this inside onCreate before starting the scan to initialize it:
results = new ArrayList<String>();
Inside your onActivityResult (), you can add the current result to an ArrayList, and then start the next scan.
/*Here is where we come back after the Barcode Scanner is done*/ public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == 0) { if (resultCode == RESULT_OK) { // contents contains whatever the code was String contents = intent.getStringExtra("SCAN_RESULT"); // Format contains the type of code ie UPC, EAN, QRCode etc... String format = intent.getStringExtra("SCAN_RESULT_FORMAT"); // Handle successful scan. In this example add contents to ArrayList results.add(contents); Intent intent = new Intent("com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_FORMATS", "PRODUCT_MODE,CODE_39,CODE_93,CODE_128,DATA_MATRIX,ITF"); startActivityForResult(intent, 0); // start the next scan } else if (resultCode == RESULT_CANCELED) { // User hass pressed 'back' instead of scanning. They are done. saveToCSV(results); //do whatever else you want. } } }
Saving them to a CSV file is beyond the scope of this specific question, but if you look around you can find examples of how to do this. Think of it as empty as an exercise for you to learn.
source share