Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
- if (resultCode == RESULT_OK) {
- if (requestCode == HISTORY_REQUEST_CODE) {
- int itemNumber = intent.getIntExtra(Intents.History.ITEM_NUMBER, -1);
- if (itemNumber >= 0) {
- HistoryItem historyItem = historyManager.buildHistoryItem(itemNumber);
- decodeOrStoreSavedBitmap(null, historyItem.getResult());
- }
- }
- }
- }
- if (Intents.Scan.ACTION.equals(action)) { // Scan the formats the intent requested, and return the result to the calling activity
- source = IntentSource.NATIVE_APP_INTENT;
- decodeFormats = DecodeFormatManager.parseDecodeFormats(intent);
- if (intent.hasExtra(Intents.Scan.WIDTH) && intent.hasExtra(Intents.Scan.HEIGHT)) {
- int width = intent.getIntExtra(Intents.Scan.WIDTH, 0);
- int height = intent.getIntExtra(Intents.Scan.HEIGHT, 0);
- if (width > 0 && height > 0) {
- cameraManager.setManualFramingRect(width, height);
- }
- }
- }
- 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
- //here is where you would get the data from the scanResult
- //and store locally by writing to a file or however you
- //intend to store it
- }
- // else continue with any other code you need in the method
- }
- public void handleDecode(Result rawResult, Bitmap barcode) {
- inactivityTimer.onActivity();
- lastResult = rawResult;
- Log.d("last result", "checking if raw result is what i expect");
- System.out.println(lastResult);
- ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);
- historyManager.addHistoryItem(rawResult, resultHandler);
- }
Add Comment
Please, Sign In to add comment