0

Android アプリケーションで zxing を使用して QR_CODE とバーコードを読み取っています。私のアプリケーションは、zxing を使用して CODE_39 を読み取ることができません。CaptureActivity OnResume メソッドで次のコードを使用しています。

Intent intent = getIntent();
        String action = intent == null ? null : intent.getAction();
        String dataString = intent == null ? null : intent.getDataString();
        if (intent != null && action != null) {
            if (action.equals(Intents.Scan.ACTION)) {
                 //Scan the formats the intent requested, and return the
                 //result
                 //to the calling activity.
                source = Source.NATIVE_APP_INTENT;
                decodeFormats = DecodeFormatManager.parseDecodeFormats(intent);

            } else if (dataString != null
                    && dataString.contains(PRODUCT_SEARCH_URL_PREFIX)
                    && dataString.contains(PRODUCT_SEARCH_URL_SUFFIX)) {
                // Scan only products and send the result to mobile Product
                // Search.
                source = Source.PRODUCT_SEARCH_LINK;
                sourceUrl = dataString;
                decodeFormats = DecodeFormatManager.PRODUCT_FORMATS;
            } else if (dataString != null
                    && dataString.startsWith(ZXING_URL)) {
                // Scan formats requested in query string (all formats if
                // none
                // specified).
                // If a return URL is specified, send the results there.
                // Otherwise, handle it ourselves.
                source = Source.ZXING_LINK;
                sourceUrl = dataString;
                Uri inputUri = Uri.parse(sourceUrl);
                returnUrlTemplate = inputUri
                        .getQueryParameter(RETURN_URL_PARAM);
                decodeFormats = DecodeFormatManager
                        .parseDecodeFormats(inputUri);
            } else {
                // Scan all formats and handle the results ourselves
                // (launched
                // from Home).
                source = Source.NONE;
                decodeFormats = null;
                }

            characterSet = intent
                    .getStringExtra(Intents.Scan.CHARACTER_SET);

この問題を解決するために私を助けてください。前もって感謝します。

4

1 に答える 1