Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • ':' is not a valid resource name character. damn it. Commented Dec 22, 2015 at 13:58
  • 1
    @SashaNos. The ':' is used in XML but for the resource name in code use '_' in place of it. See the difference in the post. I'll delete the original post if it is confusing or unhelpful Commented Dec 22, 2015 at 15:36
  • yes, I understand the difference. Android Studio just doesn't accept this name <attr name="android:text" /> because of colon :( Commented Dec 22, 2015 at 15:43
  • It does. I am using android:orientation in one of my projects now. However, you may need to ensure that you are using the correct attribute name. The list of valid names is listed in the attribute reference. Commented Dec 22, 2015 at 16:10
  • 1
    This should be the accepted answer. It requires minimal change to existing code and reads a lot cleaner. Commented Feb 15, 2019 at 19:14