How to turn off warnings for @string resource in e

2019-05-07 05:52发布

I know it's 'technically' not the best practice to be hard coding strings; but I can deal with it later - right now I just want to get the shell of my projects finished and I'm incredibly OCD about warnings in my code - is there any way to turn this off?

If my title wasn't specific enough take this as an example:

        <Button android:id="@+id/aboutBtn"
        style="@style/DashboardButton"
        android:textColor="#ffffff"
        android:text="About Vezign"
        android:onClick="aboutClick"
        android:drawableTop="@drawable/about_icon" />

The android:text="" line would be flagged as a warning for not using strings.xml and referencing it as such.

Preferably something that would turn it off for all future references; and not something I need to type (e.g. @Suppress Warnings)

Thanks!

1条回答
SAY GOODBYE
2楼-- · 2019-05-07 06:22
 Preferences > Android > Lint Error Checking > 

Scroll down to internationalization

change the severity of "HardcodedText" to 'information' or 'ignore'

查看更多
登录 后发表回答