自分のコードで QR コードをスキャンしようとしています。私のコードは 5.0(Bold) と 7.1(Torch) OS フォンで正常に動作しています。7.1 と 5.0 で正常に動作しています。しかし、6.0 OS (Bold 9700) で実行すると問題が発生します。問題は、「QRコードをスキャンしようとしているときに、アプリがQRコードをスキャンしようとすると、カメラ画面がポップせず、前面に表示されたままになります。Escキーを使用してイベントを非表示にできない」です。os6の問題を解決するのを手伝ってください。
編集:
QR コード スキャン用のカメラ画面を開いているときにコードを入力します。
Hashtable hints = new Hashtable();
// The first thing going in is a list of formats. We could look for
// more than one at a time, but it's much slower.
Vector formats = new Vector();
formats.addElement(BarcodeFormat.QR_CODE);
hints.put(DecodeHintType.POSSIBLE_FORMATS, formats);
// We will also use the "TRY_HARDER" flag to make sure we get an
// accurate scan
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
// We create a new decoder using those hints
BarcodeDecoder decoder = new BarcodeDecoder(hints);
// Finally we can create the actual scanner with a decoder and a
// listener that will handle the data stored in the QR code. We put
// that in our view screen to handle the display.
try {
_scanner = new BarcodeScanner(decoder, new LeadQRcodeDecoderListener());
_QRcodeScreen = new LeadQRcodeScannerViewScreen(_scanner);
// If we get here, all the QR code scanning infrastructure should be set
// up, so all we have to do is start the scan and display the viewfinder
_scanner.startScan();
UiApplication.getUiApplication().pushScreen(_QRcodeScreen);
}
catch (Exception e) {
e.printStackTrace();
return;
}
画面を閉じるためのコードは次のとおりです。
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
UiApplication.getUiApplication().popScreen(_QRcodeScreen);
}
});
QRコードを読み取った後、このコードを呼び出しています。