Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I clone a View?

My question is almost exactly this question:

Clone textview to append it to a ViewGroup

However, I was inflating a view, and then attempting to clone it at the object level for performance reasons (I don't want to parse XML every single time), so that answer doesn't help me. View.clone() is protected and it apparently doesn't have a copy constructor. Is there any way to do this?

like image 640
SapphireSun Avatar asked Nov 11 '10 20:11

SapphireSun


People also ask

Can you clone a view in Snowflake?

Snowflake does not allow for a clone of a view directly. If you clone the entire schema or database that contains that view, it'll work, but there is no direct clone for a view.

Can you clone in Python?

Using the copy() method The Python List copy() is an inbuilt method copy used to copy all the elements from one list to another. This takes around 1.488 seconds to complete.

How do I clone a dashboard in Vrops?

Create the dashboard Instead, we'll clone that dashboard first by selecting actions -> manage dashboards, then select our vSAN Disk Group Performance dashboard, and click the clone dashboard button.


1 Answers

You cannot clone views, the way to do it is to inflate your View every time. Note that the XML is compiled into binary which can be parsed very efficiently.

like image 64
Romain Guy Avatar answered Oct 25 '22 02:10

Romain Guy