Class and imageview

Carcas

Member
Licensed User
Longtime User
Hallo,

i have a question about class property

I would like to create a class that has an internal object imageview

my code is this:

Class code 'Oggetto

Sub Class_Globals
Public PosX As Int
Public PosY As Int
Public Altezza As Int
Public Larghezza As Int
Public Immagine As ImageView

End Sub

Public Sub Initialize(PosX_ As Int, PosY_ As Int, Altezza_ As Int, Larghezza_ As Int)
PosX = PosX_
PosY = PosY_
Altezza = Altezza_
Larghezza = Larghezza_
Immagine.Initialize(Immagine)
Immagine.Left=PosX_
.........
End Sub

and then I would call it in the main and addview into panel1

main code:

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Base")
Mattone.Initialize(20,20,100,50)
Panel1.AddView(Mattone.Immagine,Mattone.immagine.Left,Mattone.immagine.top,Mattone.immagine.Width,Mattone.immagine.Height)
End Sub

is this possible?

i have this error:

java.lang.NullPointerException

:)
 
Top