Ask the title, how can i get the languge from locale in android? I used countrycodepicker to get country code and used locale.getLanguage to get language of that country. But when i choose usa, france, british, ... it get wrong language such as USA - ikt; France - gsw?
String countryCode = ccp.getSelectedCountryNameCode();
String languageCode = null;
Locale[] all = Locale.getAvailableLocales();
for (Locale locale : all) {
String country = locale.getCountry();
if(country.equalsIgnoreCase(countryCode)){
languageCode = locale.getLanguage();
}
}