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. How to draw a piece of Bitmap

I'm creating a simple game for Android and faced with a problem: Idea
is to have a huge "map" image file and re-draw only small part of it
(320*480) depending on user actions.

I didn't find a better solution than using "public static Bitmap
createBitmap (Bitmap source, int x, int y, int width, int height)"
method and decided to try it (expected huge performance degradation),
but actually it's appeared that this method changes source bitmap and
when i call it second time source size is significantly reduced. For
instance this code:

int bitHeight = mBackgroundImage.getHeight();
int bitWidth = mBackgroundImage.getWidth();
Bitmap curMap = Bitmap.createBitmap(mBackgroundImage,
                0, mY, 320, 480);
canvas.drawBitmap(curMap, 0, 0, null);

gives 320*960 (initial source image size) size for the first time and
320*455 for the second call

I hope this is not a best solution and look forward to hearing a new
direction or at least clarification on createBitmap method.

p.s i'm not a native english speaker and i apologise for possible


2. Using SDK 1.5 to build 1.1 apps?

Hi all,
I've been playing with the 1.5 SDK recently, and understand it
contains both 1.1 and 1.5 within.

The release notes contain this dire warning:
"Note: This is an early look SDK only. The tools and documentation are
not complete. The API reference documentation for the early look SDK
is provided only in the downloadable SDK package documentation for
this early look release is not available at
To access the API reference for the early look SDK, see the
documentation in your SDK's docs/reference/ directory. "

However, does this warning apply to building 1.1 applications using
this preview release for the Market?
Or, should I step back to the Android 1.1 SDK Release 1 to build my
apps for release?

(This question is triggered by my frustration in not being able to
upload a new version of one of my apps that use Maps as of this
weekend, whereby I constantly receive "The server could not process
your apk. Try again.", as described in this thread:
, and I am somewhat scrounging for possible solutions now.)


3. Is anyone else getting bored of announced product releases that don't materialise ...

4. Samsung launches I7500, The Compan y鈥檚 First Android-Powered Mobile Phone

5. Why not build an installer for android on WM phones?

6. How To Load Previous Activity

7. Android and OpenJDK