Is there any way that a View can be cloned in Android? I have a reference to a complicated view which was first inflated from a layout, and then throughout the lifetime of the app was programatically edited, adding subviews, removing views etc.
I need some way to clone this view object. At this point in time in the app, there isn't enough information available for me to re-inflate the layout and apply all of the view modifications to it programatically to get it to match the original view.
Thanks in advance
Views can't be cloned
I think you have to implement it by yourself (constructor or method)
Can you think about another solution ? Maybe retaining the View state in another object ?
What is your case which require such a clone ?
You can't clone views, you have to inflate your view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With