Barcode orientation issue

Hi, I have an app using BarcodeScanner object.
As it is indicated on documentation, I need to have installed zxing barcode scanner in order to be able to read barcodes inside my app.
I have a problem with at least one phone: I write some data on some textboxes and when I call the barcode reader, the barcode app automatically turns screen landscape, ignoring if I don’t have enabled rotation at system level. Also, my app screen is defined as “ScreenOrientation: Portrait”, so when the barcode reader returns, some event is fired because the screen changes its orientation and all my captured data (included the returned by the barcode reader) is missed. Maybe the orientation change fires an event that calls my initialization vars, so, if I cannot stop the orientation change, how can I stop the initialization of my vars? or can I install another barcode scanner? which one?
I also tried on barcode app settings marking “no auto rotation” but the app stills rotating the screen.

I’m still doing tests.
I declare a global var named first_start and set it to “1”.
On Screen.initialize i show the value of first_start on the begining, so I compare, if first_start=1 I set it to “0” and at the very end (outside of the if) I show again its value and as I expected it is “0”.
I call the barcode scanner, and when it returns and it changes orientation I get the messages with the value of first_start first “1” and after “0”. It said to me that Initialize event was run, but also "initialize global first_start = “1"”!!! as if the app was started from scratch.
Other test, when the orientation is not changed, I get no messages after barcode returns, so, this means screen.initialize has not run, and all my values are ok (as I’m expecting).
So, then the problem is sometimes (randomly) on the same phone, the app changes orientation and acts as starting from scratch.
I don’t know what to do to solve this issue.
:frowning:

well, you also could try to use the internal scanner, just set the property UseExternalScanner to false

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

OK, I’m gonna try with this change, but, are all phones compatibles with this setting?
THX!

I made the change and it seems to work fine.
THX!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.