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. ListView touch problem

Each list item in my ListView is a linkified TextView, and a regular
The problem is that once there is a touchable item in the ListView,
the touch works only for that item, that is - only links work, but the
entire list item containing the link cannot be touch selected (only
with the trackball). I tried this also with buttons inside the list
items and the touch behavior was the same - only the button view could
be "touched".
Is there a way to make a list item touchable with touchable views


2. can't get progressbar and drawing to work together

Hi develeopers,
I tried really hard to get over this, but I found no solution.

I want to fetch images from web and display them on the canvas of a
While doing so I need to display a progressbar, so that the user has
some idea what is going on.

In the activity that owns the view I set


and then in the view I call
and at every progress:

The problem is that I have to call the progress update whenever I
fetch an image from inside the onDraw method and whatever I try (from
the Handler to the Thread) the progress updates seem to be queued and
triggered alltogether when the canvas has finished rendering, which is
quite useless.

I also tried to extract the image fetching logic out of the onDraw and
show progress there (instead of in the onDraw), before calling
invalidate, but nothing changes. The progressbar updates are always
triggered at the end.

Any help is very appreciated.

Best regards,


3. Email File using content provider

4. Need to implement Android for my website powered in PHP

5. Contacts.ContactMethods.POSTAL_LOCATION_LATITUDE returns email address instead of physical address

6. Lossless rotation of a jpeg image in Android (without fully decoding the image). How to?

7. Book or Tutorial on XML-based Layouts?