Я пользуюсь библиотекой barcodescanner.barcodescanner - невозможно решить метод resumeCameraPreview
Существует пример кода для «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)»
Я действительно не понимаю, что я делаю неправильно и как я могу исправить это, так как я просто скопировали этот код ...
Привет, будущие вопросы, пожалуйста, не используйте графику для отображения ключевого текста, как сообщение об ошибке в этом случае. Это делает ваш вопрос менее полезным для будущих пользователей. Спасибо за понимание. – Trevor