Android Question Duplicating Custom Control Instance

epiCode

Active Member
Licensed User
If I duplicate a custom control in code as follows:

B4X:
dim newcontrol1 as ccontrol
newcontrol1 = existingccontrol1

It copies all the parameters and initializes the newcontrol1

Does it also attach the newcontrol1 to same parent as existingccontrol1 ?
 

epiCode

Active Member
Licensed User
It doesn't do anything except of making the variable newcontrol1 point to the same object.
Is it possible to have another independent instance of it ?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Is it possible to have another independent instance of it ?
I'm not sure what you mean by an 'independent instance'. When you Dim an object you get a new instance of it. If you want a clone of an existing object then you will have to copy, and maybe deep copy, the salient properties to the new instance.
 
Upvote 0
Top