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. suppress all notifications

is it possible to suppress all notification messages e.g. incoming call or
sms notification?  Thanks

--
Best Regards,
Atif Gulzar

I  Unicode, zln 

--~--~---------~--~----~------------~-------~--~----~

2. "--hprof" does not work consistently with monkey tool

I could not generate the "hprof" dump using the monkey tool.

I used the following commands :
adb -d shell monkey -v 100 --hprof
adb -d shell ls /data/misc  (There was no dump in /data/misc)

However, these commands worked once, but I could not make it work
again.

Is there a workaround to make it work consistently ?
--~--~---------~--~----~------------~-------~--~----~

3. J2SE Java Application porting to Android

4. Android for HTC HD

5. Creating a Lite and Pro version of an application

6. Problem involving emulators and networking.

7. Creating a Lite and Pro version of an application