Android Question getPreviewSize error together with Orientation Change on B4XPages


Active Member
Licensed User
I need some advice how to use CameraExClass from this example together with the B4XPages - Allow Orientation Change example.

I try to change an 'old' App done with Activities to B4xPages, challenge is that all text inputs etc are done in portrait and one or multiple photos can be taken in landscape.

all is working until orientation has changed during camera preview and I get this error then:

java.lang.NoSuchMethodException: getPreviewSize []

Public Sub GetPreviewSize As CameraSize = parameters = r.RunMethod("getPreviewSize")
    Dim cs As CameraSize

    cs.Width = r.GetField("width")
    cs.Height = r.GetField("height")
    Return cs
End Sub

it looks like that parameters got 'wiped' somehow but I cant figure why :(

any advise is appreciated


p.s. the same using Activities does work properly