Show scanner
This page covers the description of how to open the camera activity
#1
DocumentReader.Instance().showScanner(completion);DocumentReader.Instance().showScanner(completion)#2
DocumentReader.Instance().showScanner(0, completion);DocumentReader.Instance().showScanner(0, completion)Completion callback
private DocumentReader.DocumentReaderCompletion completion = new DocumentReader.DocumentReaderCompletion() {
@Override
public void onCompleted(int action, DocumentReaderResults results, String error) {
// processing is finished, all results are ready
if (action == DocReaderAction.COMPLETE) {
// scanning process was finished
} else {
// something happened before all results were ready
if (action == DocReaderAction.CANCEL){
Toast.makeText(MainActivity.this, "Scanning was cancelled",Toast.LENGTH_LONG).show();
} else if(action == DocReaderAction.ERROR){
Toast.makeText(MainActivity.this, "Error:" + error, Toast.LENGTH_LONG).show();
}
}
}
};private val completion = DocumentReader.DocumentReaderCompletion { action, results, error ->
// processing is finished, all results are ready
if (action == DocReaderAction.COMPLETE) {
// scanning process was finished
} else {
// something happened before all results were ready
if (action == DocReaderAction.CANCEL) {
Toast.makeText(this@MainActivity, "Scanning was cancelled", Toast.LENGTH_LONG).show()
} else if (action == DocReaderAction.ERROR) {
Toast.makeText(this@MainActivity, "Error:$error", Toast.LENGTH_LONG).show()
}
}
}Last updated