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("");
    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 =
            EditText assetMon1 = (EditText)
        } else if (resultCode == RESULT_CANCELED) {
            // Every time I receive this code


Other Threads

1. Question: How to do EXIF reading and writing

Hi everyone,

I've been looking around on the net and in this group, but i have not
found any java package that can read and write EXIF data.

I tried Sanselan. They say they don't use ImageIO/AWT, but they
actually do use AWT. The class can not be loaded because there is an
AWT dependency:

06-17 18:18:36.883: WARN/dalvikvm(11197): VFY: unable to find class
referenced in signature (Ljava/awt/image/BufferedImage;)
06-17 18:18:41.693: WARN/dalvikvm(11197): VFY: unable to find class
referenced in signature (Ljava/awt/color/ICC_Profile;)
06-17 18:18:47.433: ERROR/dalvikvm(11197): Could not find method
java.awt.color.ICC_Profile.getInstance, referenced from method
06-17 18:18:47.433: WARN/dalvikvm(11197): VFY: unable to resolve
static method 1446: Ljava/awt/color/ICC_Profile;.getInstance ([B)Ljava/
06-17 18:18:47.433: WARN/dalvikvm(11197): VFY:  rejecting opcode 0x71
at 0x001a
06-17 18:18:47.433: WARN/dalvikvm(11197): VFY:  rejected Lorg/apache/
sanselan/Sanselan;.getICCProfile (Lorg/apache/sanselan/common/
06-17 18:18:47.433: WARN/dalvikvm(11197): Verifier rejected class Lorg/

What i want is not so much creating my own EXIF data, but preserving a
JPEG's meta-data (EXIF). I'm planning to load a JPEG, edit its bitmap
and write it out again to a(nother) JPEG with the same meta-data as
its original.

What are my options?

2. Consume a key event

I have a custom camera application...

I'm using a BroadcastReceiver to launch it when the Camera button is
pressed.  Unfortunately, once my camera app is launched the camera
button KeyDown event used to launch my camera activity is also passed
to it, which cause it to immediately attempt to capture a picture.

Is there a way to consume the KeyEvent so that this doesn't happen?

... or any other elegant solutions other then some flag toggle?



3. DEVELOPER CHALLENGE 2 - Can update of existing published app can participate?

4. Cover phone's screen & not quit

5. Does Android browser support SSL?

6. How to create an Eclipse Project for Apps-For-Android

7. How do I test an exported .apk file before shipping?