title: Styleable cannot be resolved
body: <p>Here is the code I am using:</p>
  
  <pre><code>public ASSwitch(Context context, AttributeSet attrs) {
      super(context, attrs);
      TypedArray sharedTypedArray = context.getTheme().obtainStyledAttributes(
              attrs,
              R.styleable.ASSwitch,
              0, 0);
  
         try {
             onText = sharedTypedArray.getText(R.styleable.ASSwtich_onText, null);
  
         } finally {
             sharedTypedArray.recycle();
         }
  }
  </code></pre>
  
  <p>Here is the attrs.xml file (added to values folder):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;declare-styleable name="ASSwitch"&gt;
          &lt;attr name="onText" format="string" /&gt;
          &lt;attr name="offText" format="string" /&gt;
          &lt;attr name="onState" format="boolean" /&gt;
          &lt;attr name="toogleDrawable" format="string" /&gt;
          &lt;attr name="frameDrawable" format="string" /&gt;
      &lt;/declare-styleable&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>The answers in these questions couldn't fix the problem. Please don't consider my question as duplicate.</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/1717489/android-hello-gallery-tutorial-r-styleable-cannot-be-resolved">Android Hello, Gallery tutorial -- &quot;R.styleable cannot be resolved&quot;</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/11541132/android-how-to-declare-styleable-in-r-java">Android: How to Declare Styleable in R.java?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/6675403/r-styleable-can-not-be-resolved-why">R.styleable can not be resolved, why?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/4283455/r-styleable-cannot-be-resolved">R.styleable cannot be resolved</a></p></li>
  </ul>
  
  <hr>
  
  <p><strong>Update</strong>: It seems that I was importing the wrong R class. It shall be the application's <code>R</code> class not <code>android.R</code>.</p>