Skip to content

Instantly share code, notes, and snippets.

@facebookegypt
Created January 24, 2014 09:31
Show Gist options
  • Save facebookegypt/8594489 to your computer and use it in GitHub Desktop.
Save facebookegypt/8594489 to your computer and use it in GitHub Desktop.
@string resource solution
<!-- example: XML file saved at res/values/strings.xml: -->
<!-- Android Development Solution -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="yellow">Yellow</string>
</resources>
This layout XML applies a string to a View:
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/yellow" />
Similarly colors should be stored in colors.xml and then referenced by using @color/color_name
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="Black">#000000</color>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment