I'm trying to create my own imageviews, but it generates errors when trying to set the top/left/width/height.
Here is my code:
The line with "setlayout" is the line that generates the error "java.lang.nullpointerexeption"
Here is my code:
B4X:
Sub Globals
Dim spr(128) As ImageView
Dim sheet As Bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
sheet.Initialize(File.DirAssets, "smb.png") 'ladda in bilden
spr(0).Initialize("spr")
spr(0).Enabled=True
spr(0).Visible=True
spr(0).Bitmap=sheet
spr(0).Gravity=Gravity.FILL
spr(0).SetLayout(0,0,32,32)
End Sub
The line with "setlayout" is the line that generates the error "java.lang.nullpointerexeption"