Android Question B4AZXing onActivityResult: wi is null

Frank Cazabon

Member
Licensed User
Longtime User
Hi,

I downloaded the B4AZXing library and sample and ran it successfully. Now that I am trying to implement this in my application I am getting the error when I click on the button to bring up the Scanner interface (btnScan):

onActivityResult: wi is null

and the scanner interface never shows up.

I have this code:

B4X:
Sub Globals
    Dim zx As Zxing_B4A
End Sub

Sub btnScan_Click
    zx.BeginScan("zxLoad")
End Sub

Sub zxLoad_result(atype As String,Values As String)
    Log("type:"&atype&"values:"&Values)
    Msgbox("type:"&atype&"values:"&Values,"result")
End Sub

Any ideas what I need to do to get this to work?
 

Frank Cazabon

Member
Licensed User
Longtime User
Thanks, but if I move the declaration to the Process_Globals procedure then I get an error during compilation:

Cannot access activity object from sub Process_Globals.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Did you add the required text to the manifest?
 
Upvote 0

Frank Cazabon

Member
Licensed User
Longtime User
Did you add the required text to the manifest?
No, what required text and how do I add it to what manifest?

update:

I found the Manifest Editor and compared the zxdemo manifest to mine and copied the

B4X:
AddApplicationText(<activity android:name="ice.zxing.CaptureActivity"
            android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:windowSoftInputMode="stateAlwaysHidden">
        </activity>)

text across and that seems to make it work.

Thanks for the pointer.
 
Last edited:
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Yeah, that's the text I was talking about. Glad you got sorted. ;)
 
Upvote 0
Top