title: how to resolve android.content.res.Resources$NotFoundException: Resource ID #0x7f070187 type #0x4 is not valid
body: <p>i m using below methods and i m getting android.content.res.Resources$NotFoundException: Resource ID #0x7f070187 type #0x4 is not valid.
  Code:</p>
  <pre><code>float pageMargin = getResources().getDimensionPixelOffset(R.dimen.pageMargin);
          float pageOffset = getResources().getDimensionPixelOffset(R.dimen.offset);
  
   &lt;dimen name=&quot;pageMargin&quot;&gt;20&lt;/dimen&gt;
      &lt;dimen name=&quot;offset&quot;&gt;30&lt;/dimen&gt;
  </code></pre>
  <p>Any help is appreciated!</p>