Search code examples
androidxmlandroid-actionbarr.java-file

R.Java not generated after actionbar style changes


I am working on designing the actionbar. I was trying to change the color of the main actionbar. I had written a style in style.xml. Untill then my project is working fine. After I declared my style in xml file R.Java committed suicide. The following is the xml code I had written. I had tried all the solutions given in this site. None of them worked for me.

<resources> 
    <style name="MyCustomTheme" parent="Theme.AppCompat.Light">
        <item name="android:actionBarStyle">@style/MyActionBarTheme</item>
    </style>

    <style name="MyActionBarTheme" parent="Widget.AppCompat.Light.ActionBar">
        <item name="android:background">F757575</item>
    </style>
</resources>

Someone help me

Thank you :)


Solution

  • Your color is not declared properly.

    Change

    <item name="android:background">F757575</item>
    

    to

    <item name="android:background">#FF757575</item>