Android - Language Lấy ngôn ngữ, địa điểm hiện tại của thiết bị

Sử dụng Locale:
String locale = getResources().getConfiguration().locale.getCountry();
hoặc:
String localeDis = getResources().getConfiguration().locale.getDisplayCountry();
hoặc:
String displayLanguage=Locale.getDefault().getDisplayLanguage();

Sử dụng thông tin cung cấp từ SIM:


TelephonyManager teleMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if (teleMgr != null) {
 String countryISOCode = teleMgr.getSimCountryIso();
}

Nhận xét

Bài đăng phổ biến từ blog này

Android - Make firework animation - Library

Android - Circle Image - Tạo ảnh bo tròn trong Android Studio

Android - Shortcut Key - Phím tắt trên Android Studio