gpt4 book ai didi

java - BarcodeScanner - 无法解析方法resumeCameraPreview

转载 作者:行者123 更新时间:2023-12-01 10:38:21 25 4
gpt4 key购买 nike

我正在使用barcodescanner图书馆。

有一个“SimpleScannerActivity”的示例代码:

public class SimpleScannerActivity extends Activity implements ZXingScannerView.ResultHandler {
private ZXingScannerView mScannerView;

@Override
public void onCreate(Bundle state) {
super.onCreate(state);
mScannerView = new ZXingScannerView(this); // Programmatically initialize the scanner view
setContentView(mScannerView); // Set the scanner view as the content view
}

@Override
public void onResume() {
super.onResume();
mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
mScannerView.startCamera(); // Start camera on resume
}

@Override
public void onPause() {
super.onPause();
mScannerView.stopCamera(); // Stop camera on pause
}

@Override
public void handleResult(Result rawResult) {
// Do something with the result here
Log.v(TAG, rawResult.getText()); // Prints scan results
Log.v(TAG, rawResult.getBarcodeFormat().toString()); // Prints the scan format (qrcode, pdf417 etc.)

// If you would like to resume scanning, call this method below:
mScannerView.resumeCameraPreview(this);
}
}

我已经复制了该类,一切似乎都正常。但只有重新运行onResume()方法的方法不起作用,出现以下错误消息:

mScannerView.resumeCameraPreview(this);无法解析方法“resumeCameraPreview(com.ads.adstimer.fragment.Registration.Slides,FullScannerActivity)”

enter image description here

我真的不明白我做错了什么以及如何解决这个问题,因为我刚刚复制了该代码......

最佳答案

最后解决方案很简单:

从 1.8.3 更改依赖版本:

compile 'me.dm7.barcodescanner:zxing:1.8.3'

至 1.8.4:

compile 'me.dm7.barcodescanner:zxing:1.8.4'

关于java - BarcodeScanner - 无法解析方法resumeCameraPreview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34557767/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com