I have 2 string files to 2 languages in my android app, PT and EN. But I need to know which is the string file in use because I need to add in my SQLite database the current language in use.
Actually, I'm using this code to detect the current language in my SQLite database, but this function only works if the user changes the language manually in config screen. because I don't know how to get the first language selected when the user opens the application in the first time.
if(!dbl.selectIni().getCurrent_lang().equalsIgnoreCase("system")){
String languageToLoad = dbl.selectIni().getCurrent_lang();
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
}