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. Cocos2Android

Hi  All

I installed in my Droid 2.2

http://code.google.com/p/cocos2d-android/source/browse/#svn/branches/moandroid/src/org/jbox2d

I got this error:


2010-11-07 19:17:15 - cocos2d_android] Error generating final archive: Debug
certificate expired on 11/4/10 3:23 PM!

How to generate a new Debug certificate???



THX.

-- 

2. cara menghapus widget di homescreen milestone

kemarin saya memasang widget clock di homescreen milestone.saya ingin
menghapus widget tersebut tapi saya sampai sekarng belum menemukan cara.udah

dikutak katik belum ketemu juga.mungkin teman-teman ada yang bisa
membantu.trims


Rangga

-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

3. write to xml file

4. i love dora dan spongebob

5. Google Perbaharui Mesin Pencari di Android

6. CustomDialog

7. SamdroidMod 2.0.1.alpha.8 - Froyo [AOSP] for i570