Why do I need to specify the XML namespace when using getAttributeResourceValue?
<p>I've been using custom attributes for some custom layout components without problem. So far, I've only used simple attributes (string, int, etc). These are defined like so in <code>values/attrs.xml</code>:</p>

<pre><code>&lt;declare-styleable name="StaticListView"&gt;
    &lt;attr name="border_size" format="dimension" /&gt;
&lt;/declare-styleable&gt;
</code></pre>

<p>and in my layout:</p>

<pre><code>&lt;de.example.androidapp.StaticListView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        namespace:border_size="1px"
   /&gt;
</code></pre>

<p>and used like so:</p>

<pre><code>int borderSize = (int) a.getDimension(R.styleable.StaticListView_border_size, 0);
</code></pre>

<p>Now, I'm trying to specify a layout as a custom attribute and am not able to use the <code>R.styleable</code> method used above.</p>

<p>Here's how I'm defining the attribute:</p>

<pre><code>&lt;declare-styleable name="StaticListView"&gt;
    &lt;attr name="emptyLayout" format="reference" /&gt;
&lt;/declare-styleable&gt;
</code></pre>

<p>and using it:</p>

<pre><code>&lt;de.example.androidapp.StaticListView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        namespace:emptyLayout="@layout/empty"
   /&gt;
</code></pre>

<p>And this is how I would like to use it, but I always get the default value (<code>-1</code>):</p>

<pre><code>int emptyLayoutInt = attrs.getAttributeResourceValue(R.styleable.StaticListView_emptyLayout, -1);
</code></pre>

<p>This, however, works:</p>

<pre><code>int emptyLayoutInt = attrs.getAttributeResourceValue("http://schemas.android.com/apk/res/de.example.androidapp", "emptyLayout", -1);
</code></pre>

<p>I dislike having to hardcode the XML namespace. Using the <code>R.styleable</code> attribute avoids this in a nice way.</p>

<p>Am I doing something wrong or is this a bug/expected behavior?</p>
