mirror of
https://github.com/zxing/zxing.git
synced 2025-02-21 02:55:27 -08:00
Issue 740 user-suggested patch to return bytes
git-svn-id: https://zxing.googlecode.com/svn/trunk@1724 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
9e8fb1e2ff
commit
27445b32cd
|
@ -532,6 +532,10 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
intent.putExtra(Intents.Scan.RESULT, rawResult.toString());
|
||||
intent.putExtra(Intents.Scan.RESULT_FORMAT, rawResult.getBarcodeFormat().toString());
|
||||
byte[] rawBytes = rawResult.getRawBytes();
|
||||
if (rawBytes != null && rawBytes.length > 0) {
|
||||
intent.putExtra(Intents.Scan.RESULT_BYTES, rawBytes);
|
||||
}
|
||||
Message message = Message.obtain(handler, R.id.return_scan_result);
|
||||
message.obj = intent;
|
||||
handler.sendMessageDelayed(message, INTENT_RESULT_DURATION);
|
||||
|
|
|
@ -93,6 +93,12 @@ public final class Intents {
|
|||
*/
|
||||
public static final String RESULT_FORMAT = "SCAN_RESULT_FORMAT";
|
||||
|
||||
/**
|
||||
* Call intent.getByteArrayExtra(RESULT_BYTES) to get a {@link byte[]} of raw bytes in the
|
||||
* barcode, if available.
|
||||
*/
|
||||
public static final String RESULT_BYTES = "SCAN_RESULT_BYTES";
|
||||
|
||||
/**
|
||||
* Setting this to false will not save scanned codes in the history.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue