F Frank Cazabon Member Licensed User Longtime User Aug 11, 2014 #1 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: Code: Copy 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?
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: Code: Copy 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?
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2014 #2 Make zx a process global variable. Upvote 0
F Frank Cazabon Member Licensed User Longtime User Aug 12, 2014 #3 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
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.
barx Well-Known Member Licensed User Longtime User Aug 12, 2014 #4 Did you add the required text to the manifest? Upvote 0
F Frank Cazabon Member Licensed User Longtime User Aug 12, 2014 #5 barx said: Did you add the required text to the manifest? Click to expand... 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 Code: Copy 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: Aug 12, 2014 Upvote 0
barx said: Did you add the required text to the manifest? Click to expand... 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 Code: Copy 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.
barx Well-Known Member Licensed User Longtime User Aug 12, 2014 #6 Yeah, that's the text I was talking about. Glad you got sorted. Upvote 0