新增通过后端获取国家地区信息接口在注册时自动填写号码编号

This commit is contained in:
2023-04-03 15:15:50 +08:00
parent c43b581157
commit 192587f758
3 changed files with 9 additions and 8 deletions

View File

@@ -194,10 +194,9 @@ public class RegisterActivity extends AbsActivity {
//String ct = Locale.getDefault().getCountry();
String ct = IMLoginManager.get(mContext).getString("sys_user_area");
ToastUtil.show("地区:"+ct);
ct = TextUtils.equals("CN", ct) ? "HK" : ct;
ct = TextUtils.equals("中国", ct) ? "HK" : ct;
for (int i = 0; i < allCountries.size(); i++) {
if (allCountries.get(i).locale.equals(ct)) {
if (allCountries.get(i).chs.equals(ct)) {
String countryName = allCountries.get(i).name;
countryName = countryName.length() > 4 ? countryName.substring(0, 4) : countryName;
mTvCountryCode.setText("+" + allCountries.get(i).code + " " + countryName);