Android Question Detect type of custom view

Guenter Becker

Active Member
Licensed User
Hello,
assume we have this code:
Dim ZI as ZoomImageView ' custom view
dim lbl as Label ' standard view
dim P as Panel
P.Initialize("")
ZI.initialize("ZI")
lbl,.initialize("lbl")
....
P.addview(ZI,0,0,ZI.width,ZI.height)
P.addview(lbl,0,100,lbl.width,lbl.height)

for each v as object in P.GetAllViewsRecursive
if v is label then log(v.as(View).tag) ' is working
if v is ZoomImageView then ..... ' Does not work
next

I am using the TAG Object of the View therefore this can not be used for other things .
How can I detect the type of the custom view?

Any Idea?
Thank you in advance.
 

Alexander Stolte

Expert
Licensed User
Longtime User
B4X:
if v.Tag is ZoomImageView then ..... ' Does work now
 
Upvote 1
Top