Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to copy all properties of a view?
    text
    copied!<p>I’m creating an currency exchange rate application to learn Android. The app will list all exchange rate in a list, each of them has the layout like this (in essential):</p> <pre><code>&lt;TableRow&gt; &lt;ImageView&gt; [properties for the Flag image here] &lt;/ImageView&gt; &lt;TableLayout&gt; &lt;TableRow&gt; &lt;TextView&gt; [Buying] &lt;/TextView&gt; &lt;TextView&gt; [Buying Rate] &lt;/TextView&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView&gt; [Transfer] &lt;/TextView&gt; &lt;TextView&gt; [Transfer Rate] &lt;/TextView&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;TextView&gt; [Selling] &lt;/TextView&gt; &lt;TextView&gt; [Selling Rate] &lt;/TextView&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;/TableRow&gt; </code></pre> <p>To list exchange rate for all currencies I have the following approach:</p> <pre> - Design the layout for one currency (let’s choose EUR as first currency) - Generate the layout for all other currencies automatically by: 1. Copy all properties of the EUR-layout into the new currency layout 2. Modify some properties of new currency layout like: ID, Rates … 3. Repeat steps 1,2 for all sub-layout of the new currency layout </pre> <p>But I don’t know how to code step 1, so I did a lot of google about: “android copy view” “android copy properties” “android copy view” “android clone view” “java clone object” …. but still no solution. <br><br> <strong>So, my question is: how to copy all properties of a view ?</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload