Integration problem ZXing via Intent

by Gustavo Costa » Thu, 19 May 2011 20:01:43 GMT


Sponsored Links
 Well, I'm trying implement a integration of zxing with my Android App.
In my app there is a MainActivity. In this MainActivity, I use a
button to execute the first block of code below. But every time when
execute the first block of code and the app read the QR Code, I
receive as resultCode the value RESULT_CANCELED in the second block.
The second block is executed as soon as the ZXing Activity is opened.
What do I doing wrong?

First Block of Code

Intent intent1 = new Intent("com.google.zxing.client.android.SCAN");
    intent1.setPackage("com.google.zxing.client.android");
    intent1.putExtra("SCAN_MODE", "ONE_D_MODE");
    startActivityForResult(intent1, 0);

Second block of code

public void onActivityResult2(int requestCode, int resultCode, Intent
intent2) {
    if (requestCode == 0) {
        if (resultCode == RESULT_OK) {
            String contents2 = intent2.getStringExtra("SCAN_RESULT");
            String format2 =
intent2.getStringExtra("SCAN_RESULT_FORMAT");
            EditText assetMon1 = (EditText)
findViewById(R.id.assetMon1);
            assetMon1.setText(contents2);
        } else if (resultCode == RESULT_CANCELED) {
            // Every time I receive this code
        }
    }
}

-- 



Other Threads

1. Thin Java over C++ App

In order to easily and quickly port a C++ app to Android, can one just
write a thin Java layer that gets the screen contents from C++ and
blits it to the display; and sends mouse clicks to a C++ handler ?

Or would this not work for some reason ?

-- 

2. Greystripe experiences?

Hi all

Is anyone using Greystrip for ads within their apps?  Care to share
experiences?

In particular:

1. Any hassles getting payments from them?

2. eCPM comparisons with other ad networks?

Many thanks ...

-- 

3. is .pvr textures supported by 2.2 devices? how do i load them?

4. How to configure SDK emulator to start with english instead of japanese?

5. Switching Tab Activities from Sub Activities.

6. How to read pdf file into my customize android app

7. Is it possible to determine a input method in application