Android Question getPreviewSize error together with Orientation Change on B4XPages

madru

Active Member
Licensed User
Longtime 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 []

B4X:
Public Sub GetPreviewSize As CameraSize
    r.target = parameters
    r.target = 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

THX

p.s. the same using Activities does work properly
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…