实际上我使用Output Intent
fromDataWedge
将解码后的数据发送到我的应用程序,所以在应用程序中记录了一个 BroadcastReceiver 来获取解码后的数据
private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (Objects.equals(action, getResources().getString(R.string.activity_intent_filter_action))) {
// Received a barcode scan
try {
displayScanResult(intent);
} catch (Exception e) {
// Catch if the UI does not exist when we receive the broadcast
}
}
}
};
问题是是否可以在不使用 EMDK 的情况下以某种方式禁用扫描仪?如果以下条件为真,我将能够禁用扫描:
if(Alerts.dialogError != null && Alerts.dialogError.isShowing()){
// Here i should block the scanner
}