2
当我使用以下代码时,它始终将国家代码显示为US。android:如何在仿真器中手动设置国家代码
context = MainActivity.this;
String locale = context.getResources().getConfiguration().locale.getCountry();
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.getSimCountryIso();
如何手动设置国家代码设置为IN(印度)在模拟器中。
这改变了语言环境,而不是SIM国家代码(有时也称为MCC)。 – zmbq
@zmbq好的,但是OP的locale不是来自SIM。 – Henry