Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R.styleable can not be resolved, why?

I have a resources.xml file located under direcotry values/ , That's

/values/resources.xml

<?xml version="1.0" encoding="utf-8"?>  <resources>      <declare-styleable name="TheMissingTabWidget">          <attr name="android:divider" />      </declare-styleable>  </resources> 

In my java code, when I try to access this resource by R.styleable.TheMissingTabWidget , eclipse complain that styleable cannot be resolved or is not a field. Why? Why I can not access this resource? (I am using android 2.1-updated).

like image 799
Leem Avatar asked Jul 13 '11 07:07

Leem


1 Answers

plz make values/attrs.xml resources like this

<?xml version="1.0" encoding="utf-8"?> <resources>     <declare-styleable name="**com.admob.android.ads.AdView**"><--- where u want to use        <attr name="backgroundColor" format="color" />        <attr name="TextColor" format="color" />        <attr name="keywords" format="string" />        <attr name="refreshInterval" format="integer" />     </declare-styleable> </resources> 
like image 117
Arun Avatar answered Sep 24 '22 15:09

Arun