Android Question How to initialise B4XView?

Smee

Well-Known Member
Licensed User
Longtime User
I am trying to use and understand these views but I get an error
java.lang.RuntimeException: Object should first be initialized (B4XView).

The code is extremely simple
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    Private ImageView1 As B4XView
    Dim xui As XUI
    Dim exif As ExifData
End Sub

Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        Dim fname As String
        Dim bmp As B4XBitmap
        fname = "1105.jpg"
        File.Copy(File.DirAssets, fname, File.DirRootExternal, fname)

        bmp = xui.LoadBitmap(File.DirAssets,fname)
        Activity.LoadLayout("b4xviewtest")
    End If
    ImageView1.SetBitmap(bmp)
    FillImageToView(bmp,ImageView1)
    exif.Initialize(File.DirRootExternal, fname)
End Sub

so How is the Imageview initialised
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…