Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just found the issue. First, you can only override layout_* attributes, so the background won't work. That is documented behavior and simply an oversight on my part.</p> <p>The real problem is found in LayoutInflater.java:</p> <pre><code>// We try to load the layout params set in the &lt;include /&gt; tag. If // they don't exist, we will rely on the layout params set in the // included XML file. // During a layoutparams generation, a runtime exception is thrown // if either layout_width or layout_height is missing. We catch // this exception and set localParams accordingly: true means we // successfully loaded layout params from the &lt;include /&gt; tag, // false means we need to rely on the included layout params. ViewGroup.LayoutParams params = null; try { params = group.generateLayoutParams(attrs); } catch (RuntimeException e) { params = group.generateLayoutParams(childAttrs); } finally { if (params != null) { view.setLayoutParams(params); } } </code></pre> <p>If the &lt;include&gt; tag does not include <strong>both</strong> layout_width and layout_height, the RuntimeException occurs and is silently handled, without any log statement even.</p> <p>The solution is to always include both layout_width and layout_height when using the &lt;include&gt; tag, if you want to override any of the layout_* attributes.</p> <p>My example should change to:</p> <pre><code>&lt;include android:id="@+id/buttons_override" android:layout_width="fill_parent" android:layout_height="wrap_content" layout="@layout/buttons"/&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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