Polarbear0106 Polarbear0106 - 1 year ago 151
Java Question

Java files: Suppressing hardcoded text warnings?

Due to having to add separators in TextView's(e.g.

...+ "," +...
) I get Hardcoded text warnings. ("Do not concenate text...")

I tried using both SupressLint and SupressWarnings:


But it does not work. How can I block these annoying warnings?

Answer Source

The name of the lint check you want to suppress is SetTextI18n, not HardcodedText.

You can also use

//noinspection AndroidLintSetTextI18n

to target the suppression to the following code line only and not the whole method or class.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download