1. Check out our app, Forums for Android! Download and leave feedback here!

Problems with colors.xml

Discussion in 'Application Development' started by aleckan, Nov 6, 2010.

  1. aleckan

    aleckan New Member
    Thread Starter
    5

    Nov 6, 2010
    1
    0
    5
    I have a colors.xml file located in the res/values fodler.

    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <resources>
    4.     <color name="transparent">#00000000</color>
    5.     <color name="menu_selected">#00feff9c</color>
    6.     <color name="menu_unselected">#00cccccc</color>
    7. </resources>
    8.  
    When I try to use this colors they can't be found. This is the code I use to get the colors (Android 2.0 if that matters).

    Code (Text):
    1.  
    2. android:textColor="@color/menu_selected"
    3.  
    and in I've tryed through the code...

    Code (Text):
    1.  
    2. text_1.setTextColor(getResources().getColor(R.color.menu_selected));
    But this is what I get in the debug logcat inside eclipse.

    What am I doing wrong?

    Please help =)

    best regards
    Alexander
     

    Advertisement

Share This Page

Loading...