資源簡介
public class ChiceScanGunActivity extends Activity{
@Override
protected boolean onKeyEvent(KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
int keyCode = event.getKeyCode();
if (keyCode <= 6) {
return false;
}
if (mScanGun.isMaybeScanning(keyCode, event)) {
return true;
}
}
return true;
}
@Override
public void onCreate() {
super.onCreate();
//TODO
mScanGun = new ScanGun(new ScanGunCallBack() {
@Override
public void onScanFinish(String scanResult) {
if (!TextUtils.isEmpty(scanResult)) {
Toast.makeText(DetectionService.this.getBaseContext(),
"無界面監聽掃描槍數據:" + scanResult, Toast.LENGTH_SHORT).show();
}
}
});
mScanGun.setMaxKeysInterval(50);
}
}

代碼片段和文件信息
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????8211??2018-09-18?13:20??ChiceScanGun.jar
-----------?---------??----------?-----??----
?????文件????????8211??2018-09-18?13:20??ChiceScanGun.jar
評論
共有 條評論