コード例 #1
0
  /**
   * A valid barcode has been found, so give an indication of success and show the results.
   *
   * @param rawResult The contents of the barcode.
   * @param bundle The extras
   */
  public void handleDecode(Result rawResult, Bundle bundle) {
    inactivityTimer.onActivity();
    beepManager.playBeepSoundAndVibrate();

    bundle.putInt("width", mCropRect.width());
    bundle.putInt("height", mCropRect.height());
    bundle.putString("result", rawResult.getText());

    startActivity(new Intent(CaptureActivity.this, ResultActivity.class).putExtras(bundle));
  }
コード例 #2
0
 @Override
 protected void onPause() {
   if (handler != null) {
     handler.quitSynchronously();
     handler = null;
   }
   inactivityTimer.onPause();
   beepManager.close();
   cameraManager.closeDriver();
   if (!isHasSurface) {
     scanPreview.getHolder().removeCallback(this);
   }
   super.onPause();
 }