Question: I would like to create a button style which all of my buttons use, this way I do not need to set the android:textColor on each one.

I have this styling in a file named defaultbutton.xml

```
<item android:state_pressed="false" android:state_focused="false">
    <shape android:shape="rectangle">
        <solid android:color="#F3C22C"/>
        <corners android:radius="10dp" />
    </shape>
    <color android:color="@color/brown"></color>
</item>

```

And for a test button I set:

```
android:background="@drawable/defaultbutton"

```

The button gets the background color but the text color stays as black. 

What am I doing wrong?

Answer: 
You need to add color attribute to the item tag to set color of text.

`/res/drawable/custom_color.xml`

```
<item android:state_pressed="false" android:state_focused="false"
      android:color="@color/text_color"> //this is how text color can be defined

</item>

```

Now set `textColor` to the `textView` of your layout

```
<TextView  ...
    android:textColor="@drawable/custom_color">

```
You can go to "styles.xml" file, you can find it in "values" folder
and add the following lines to the file :

```
<style name="buttonstyle" >
        <item name="android:textColor" >#ff11</item>
</style>

```

after that when you add button add this line to your button attr.

```
style="@style/buttonstyle"

```