title: Android Resource IDs
body: <p>I'm retrieving custom Resource IDs from a custom xml view type. I'm asked to specify a default int value for the retrieval and was wondering what is the range of IDs? Are they always positive or do they include zero??</p>
  
  <p>i.e is -1 a valid "null" reference AND/OR is 0 a valid "null" reference?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Custom XML resource/attribute file</p>
  
  <pre><code>&lt;resources&gt;
      &lt;declare-styleable name="ToggleImageButton"&gt;
          &lt;attr name="onImage" format="integer" /&gt;
          &lt;attr name="offImage" format="integer" /&gt;
      &lt;/declare-styleable&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Defined in my constructor for my custom ui</p>
  
  <pre><code>TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ToggleImageButton);
  
  int offResource = a.getInt(R.styleable.ToggleImageButton_offImage, -1);
  </code></pre>
  
  <p>Basically the -1 at the end of the 2nd line is the default parameter for this data type. It may or may not be initialized in the XML view when developing and this allows default behavior to be specified this way.</p>