简体   繁体   English

android:如何在模拟器中手动设置国家/地区代码

[英]android : How to set Country code manually in emulator

When i use following code , it always shows the country code as US. 当我使用以下代码时,它始终将国家/地区代码显示为US。

context = MainActivity.this;
String locale = context.getResources().getConfiguration().locale.getCountry();

TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.getSimCountryIso();

How can i manually set set country code to IN (india) in emulator. 如何在模拟器中手动将设置国家/地区代码设置为IN(印度)。

This is done the same way as on a real device. 这与在真实设备上完成的方式相同。 Open the seetings app, got to "Language and Input" -> "Language" and select "English (India)" 打开seetings应用程序,进入“语言和输入” - >“语言”并选择“英语(印度)”

Run>Debug Configurations/Run Configurations 运行>调试配置/运行配置

Tab Target> Additional Emulator Command Line Options 选项卡目标>其他仿真器命令行选项

-timezone Asia/India -timezone亚洲/印度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM