define an imageview in a type def

WAZUMBi

Well-Known Member
Licensed User
Longtime User
Is not possible to define an image view inside a type definition?

For example this code will not work:

B4X:
Type exampleData(imv as ImageView, a as int, b as int)
Dim example as exampleData

example.imv.Initialize("imv")
Activity.AddView(example.imv, 0, 0, 50dip, 50dip)

I get a null pointer exeption
 

WAZUMBi

Well-Known Member
Licensed User
Longtime User
That was it. Thank you.

Curious:
Is it only when you add views to a type that the type must first be initialized? I havn't had to initialize a type before this way.
 
Upvote 0
Top