I\'ve updated ADT to v. 21 and new warning appeared in this code:
if (e.getMessage().toLowerCase().contains(\"blabla\"))
Implicitly using the default locale
Actually, use Locale.getDefault()
when the goal is to present text to the user. However, and this is the whole point of the Lint check, you should probably be using Locale.US
whenever the goal is for machine readability/usage. Because it is already implicitly using Locale.getDefault()
if you don't specify one, and this can cause hard to find bugs when devices have their own default locale specified. It seems that you also need to clean your project either way, as everyone else has suggested.
It's probably a Lint bug. Just try to cut the whole line of code
if (e.getMessage().toLowerCase(Locale.ENGLISH).contains("blabla"))
save, then paste.
You should use Locale.getDefault()
especially if you cant be sure that your text will always be in english.
Also lint errors like that one you are having usually disappear after you run lint again or clean your project.
Cleaning the project didn't work for me, so I added the default locale on my code:
String.format(Locale.getDefault(), "firstname: %s, lastname: %s", firstName, lastName));
Depending on your project, you might want to take a look at the Locale explanation.
use Locale.getDefault() and than clean your project.
You simply need to clean your project by clicking:
Build > Clean Project
or Build > Rebuild Project