Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the problem is caused by the manner you prepare the layouts in <code>prepareThemes()</code>.</p> <p>You didn't mention, but I assume your 'layout/widget_configure.xml' defines a structure like this:?</p> <pre><code>&lt;LinearLayout android:id="@+id/root"&gt; &lt;LinearLayout android:id="@+id/themeLayout&gt; &lt;!-- ... --&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/colorLayout&gt; &lt;!-- ... --&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/transpLayout&gt; &lt;!-- ... --&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>Then you inflate this in <code>prepareThemes()</code> to get the 3 sub layouts. But at this moment they are already registered as children of the surrounding layout (which I called "root"). As the error implies a <strong>view instance can be added to just one parent</strong>.</p> <p>You could store each LinearLayout in its own xml file and then inflate 3 times. Those stored layouts then could be add exactly once to a child.</p> <p>I'm not sure what you want to do, but I would guess, it would be better - instead of preparing - to just have 3 different layouts that include the part from <code>layout.itemrow</code> and then just make a <code>switch case</code> in <code>getChildView()</code> and inflate the needed layout on the fly. Because even when you store a not bind layout in prepareThemes: As soon as you have more then one group you would get the same error when adding a prestored layout to the child of the snd group.</p> <p>I hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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