Maybe a stupid question but i want to use a if statement in my code, but i won’t work.
String Country = getResources().getConfiguration().locale.getLanguage();
if (Country = nl);
So i want to use the if statement to do a function when the Country String is “nl” but i don’t know how to use the if statement i think.
It’s
Now:
==.equals.Some more info for future use: using
==to test equality checks if the references are the same (i.e. they are the same object in memory), which usually is not what you need (of course, using it for primitive values works as expected). For cases when you want to have custom equality checks on types you can override theequalsmethod and place your logic there. This is what happens in case of theStringclass.