문제

When i use following code , it always shows the country code as 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.

도움이 되었습니까?

해결책

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)"

다른 팁

Run>Debug Configurations/Run Configurations

Tab Target> Additional Emulator Command Line Options

-timezone Asia/India

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top