I need to find how many language's string.xml is present in my application at run time. Example: I have string.xml for en, zh,fr.. and now my server is sending me language type as hi then I should check whether hi present in values folder or not???
Thanks in advance.
Since your strings could be in a file other than
string.xml
, here's a more robust way to do this:Take a string id that you know is translated into all your supported languages and test if it's different than the default.
Note that
Configuration.locale
is deprecated since Nougat. See the docs for update.