Closed mateusz-bak closed 2 years ago
In the manifest, you need to set the orientation for the Activity used for capturing (com.journeyapps.barcodescanner.CaptureActivity
by default), not your .MainActivity
.
It works now, I didn't understand it properly before. Thank you!
Description of the problem:
Scanner works only in portrait mode when called from a fragment.
Which library version are you using? 4.3.0
Which phone/tablet are you using, and which Android version does it run? OnePlus 8T, Android 11
Does the same happen on other devices or an emulator? Yes
Can you reproduce the issue in the sample project included with the library? If not, can you provide your own sample project or sample code that produces this error?
My Fragment code:
Manifest code for the main activity:
Doesn't matter whatever I set in android:screenOrientation or in options.setOrientationLocked, the scanner always opens in landscape mode.