Show scanner
This page covers the description of how to open the camera activity
Show scanner
#1
DocumentReader.Instance().showScanner(MainActivity.this, completion);DocumentReader.Instance().showScanner(this@MainActivity, completion)#2
DocumentReader.Instance().showScanner(MainActivity.this, 0, completion);DocumentReader.Instance().showScanner(this@MainActivity, 0, completion)Completion callback
private IDocumentReaderCompletion completion = new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, DocumentReaderResults results, Throwable 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 = IDocumentReaderCompletion { 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()
}
}
}Close scanner
Last updated