Android Question Copy from view

devmobile

Active Member
Licensed User
I have view that i need copy from it
I use
Dim im as ImageView
im = imgicon

But when i change im variable,it apply on main imageview
 

DonManfred

Expert
Licensed User
Longtime User
im is a reference to imgicon. If you change im, imgicon is change too. For sure.
 
Upvote 0

devmobile

Active Member
Licensed User
You cannot make a copy of the view itself. You can make another view with same layout and setting.

B4X:
Dim im as ImageView
'.....

Dim im2 as ImageView
dim p as panel = im.parent
p.addview(im2,im.left,im.top,im.width,im.height)
im2.gravity = im.gravity
im2.bitmap = im.bitmap
Yes it is good solution
Thanks
 
Upvote 0
Top