Creating a clone of a view on Android

Is there a way that one can clone a view in Android? I have a link to a complex view that was initially inflated from the layout and then programmed throughout the entire application runtime to add subviews, remove views, etc.

I need a way to clone this view object. There is not enough information in the app at this time for me to re-inflate the layout and apply all view modifications to it programmatically to match the original view.

Thank you in advance

+3


source to share


2 answers


Opinions cannot be cloned

I think you should implement it yourself (constructor or method)



Can you think of another solution? Maybe persisting the state of the View in another object?

What is your case that such a clone requires?

+3


source


You cannot clone views, you have to inflate your view.



+1


source







All Articles