如何在android代码中获取我的SIM的国家代码.我用过
TelephonyManager tm = (TelephonyManager)getSystemService(getApplicationContext().TELEPHONY_SERVICE);
String countryCode = tm.getNetworkCountryIso();
Run Code Online (Sandbox Code Playgroud)
但在这里,我为孟加拉国获得了像"BD"这样的国家名称,我需要为孟加拉国提供+880.这段代码的工作原理与此类似.
Locale.getDefault().getCountry();我需要代码为+ 91代表ind,+ 880代表bd.