Polarbear0106 Polarbear0106 - 4 months ago 23
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?


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.