Search code examples
stringtextcolor

Error String types not allowed


sorry I'm beginner when i build the app it show me that error

String types not allowed (at 'android:text Color Primary' with value 'TITLE_COLOR_GOES_HERE').


Solution

  • If you want to use some color there are two ways :

    Either you can directly use colorcode

    yourTextView.setTextColor(Color.RED);

    Or you can define some color in your colors.xml file in resource and use it yourTextView.setTextColor(colors.red);

    While setting color , you need to either define that color name as string in your colors.xml file in your resources folder (res) or use like Color.RED or your preferable color