【发布时间】:2015-08-11 20:25:51
【问题描述】:
我无法获得用户使用我的 Android 应用程序的确切国家/地区。 我尝试了很多方法,但没有得到确切的答案。
首先我像这样使用 TelephonyManager 但没有得到准确的答案
TelephonyManager tMgr = (TelephonyManager) CheckCountry.this
.getSystemService(Context.TELEPHONY_SERVICE);
phNo = tMgr.getLine1Number();
然后我使用了这个,但它通过从我的手机设置获取返回值
String locale = getApplicationContext().getResources()
.getConfiguration().locale.getCountry();
有任何确切的解决方案,我可以通过它获得国家名称,然后让我知道
【问题讨论】:
标签: android android-activity android-studio telephonymanager