title: How to get a string from attr with reference format type?
body: <p>I have my custom <code>attr.xml</code> document in which I specified <code>declare-styleable</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
  
      &lt;declare-styleable name="EditTextValidateablePreference"&gt;
          &lt;attr name="errorMessage" format="reference" /&gt;
      &lt;/declare-styleable&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>Then in layout I set:</p>
  
  <pre><code>&lt;com.xx.yy.EditTextValidateablePreference
      ...
      ns:errorMessage="@string/validation_email_mail_server_invalid"
      /&gt;
  </code></pre>
  
  <p>And in <code>EditTextValidateablePreference.class</code> I get it with:</p>
  
  <pre><code>    String validatorErrorMessage = attrs.getAttributeValue(PREFERENCE_NS, "errorMessage");
  </code></pre>
  
  <p><code>validatorErrorMessage</code> has a value like: <code>@2131099700</code></p>
  
  <p>How can I get its integer value to use it with:</p>
  
  <pre><code>context.getResources().getString(messageId)
  </code></pre>
  
  <p>?</p>
  
  <p>Thanks !</p>