gpt4 book ai didi

android - 如何获得印度的+91之类的移动国家代码?

转载 作者:太空狗 更新时间:2023-10-29 12:44:20 25 4
gpt4 key购买 nike

我试过使用 TelephonyManager

TelephonyManager telephonyManager=(TelephonyManager)getBaseContext().
getSystemService(Context.TELEPHONY_SERVICE);
String CountryIso= telephonyManager.getNetworkCountryIso();
String NetworkIso=telephonyManager.getSimCountryIso();

最佳答案

关于这个总是有大量的讨论,我一直不明白为什么开发人员和公司会采用复杂的方式。用户选择的语言,是指他/她希望在他/她的手机中始终看到的语言。他们不打算使用与其他人或系统不同的语言的应用程序。

选择非常简单:使用 Locale(让用户选择首选语言),或者尽最大努力激怒他们,以他们已经表示不想看到的语言向他们展示信息.

要获取国家代码,请使用:

Locale.getDefault().getCountry();

关于android - 如何获得印度的+91之类的移动国家代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20926236/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com