当前位置:编程学习 > wap >>

barcode


public void handleDecode(Result rawResult, Bitmap barcode) {
  
    inactivityTimer.onActivity();
    lastResult = rawResult;
    ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

    boolean fromLiveScan = barcode != null;
    if (fromLiveScan) {
      historyManager.addHistoryItem(rawResult, resultHandler);
      // Then not from history, so beep/vibrate and we have an image to draw on
      // 然后不从历史,所以哔哔,而我们有个振动/图像上绘制 
      
      
      Log.d("lastResult", String.valueOf(lastResult));
            intent=new Intent(this,CaptureActivity.class);
startActivity(intent); 
      beepManager.playBeepSoundAndVibrate();
      drawResultPoints(barcode, rawResult);
    }

    switch (source) {
      case NATIVE_APP_INTENT:
      case PRODUCT_SEARCH_LINK:
        handleDecodeExternally(rawResult, resultHandler, barcode);
        break;
      case ZXING_LINK:
       
        if (returnUrlTemplate == null){
          handleDecodeInternally(rawResult, resultHandler, barcode);
        } else {
          handleDecodeExternally(rawResult, resultHandler, barcode);
        }
        break;
      case NONE:
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
          String message = getResources().getString(R.string.msg_bulk_mode_scanned)
              + " (" + rawResult.getText() + ')';
          Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
          // Wait a moment or else it will scan the same barcode continuously about 3 times
          // 稍等,否则它将扫描相同的条形码持续约3倍     
          restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
        } else {
          handleDecodeInternally(rawResult, resultHandler, barcode);
        }
        break;
    }
  }
[code=objc]
[/code]

红线哪里无法实现跳转 --------------------编程问答--------------------
引用 楼主 wodemengxiang01 的回复:

public void handleDecode(Result rawResult, Bitmap barcode) {
  
    inactivityTimer.onActivity();
    lastResult = rawResult;
    ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

    boolean fromLiveScan = barcode != null;
    if (fromLiveScan) {
      historyManager.addHistoryItem(rawResult, resultHandler);
      // Then not from history, so beep/vibrate and we have an image to draw on
      // 然后不从历史,所以哔哔,而我们有个振动/图像上绘制 
      
      
      Log.d("lastResult", String.valueOf(lastResult));
            intent=new Intent(this,CaptureActivity.class);
startActivity(intent); 
      beepManager.playBeepSoundAndVibrate();
      drawResultPoints(barcode, rawResult);
    }

    switch (source) {
      case NATIVE_APP_INTENT:
      case PRODUCT_SEARCH_LINK:
        handleDecodeExternally(rawResult, resultHandler, barcode);
        break;
      case ZXING_LINK:
       
        if (returnUrlTemplate == null){
          handleDecodeInternally(rawResult, resultHandler, barcode);
        } else {
          handleDecodeExternally(rawResult, resultHandler, barcode);
        }
        break;
      case NONE:
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
          String message = getResources().getString(R.string.msg_bulk_mode_scanned)
              + " (" + rawResult.getText() + ')';
          Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
          // Wait a moment or else it will scan the same barcode continuously about 3 times
          // 稍等,否则它将扫描相同的条形码持续约3倍     
          restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
        } else {
          handleDecodeInternally(rawResult, resultHandler, barcode);
        }
        break;
    }
  }
[code=objc]
[/code]



红线哪里无法实现跳转


不好意思, 没太懂起你说的红线那里
补充:移动开发 ,  Android
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,