Reference color resource in TextView
Description
The following code shows how to Reference color resource in TextView
Example
res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="background_color">#aa0000</color>
</resources>
Layout xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background_color"
android:gravity="center"
android:text="Hello World, MainActivity!" />