5.4.4. colors.xml
This app displays correct answers in green and incorrect answers in red. As with any other resource, color resources should be defined in XML so that you can easily change colors without modifying your app’s Java source code. Typically, colors are defined in a file name colors.xml, which you must create. As you learned in Section 3.4.5, colors are defined using the RGB or ARGB color schemes.
To create the file and configure the two color resources, perform the following steps:
1. In the project’s res folder, right click the values folder, then select New > Android XML File to display the New Android XML File dialog.
2. Specify colors.xml in the File field and click Finish to create the file.
3. If the IDE opens the new file ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access