【发布时间】:2020-02-21 14:31:44
【问题描述】:
实际上我使用DataWedge 中的Output Intent 将解码后的数据发送到我的应用程序,因此在应用程序中记录了一个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
}
【问题讨论】: