Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows下安卓模拟器语言检测错误null问题 #24

Closed
trainliang opened this issue Jul 8, 2021 · 3 comments
Closed

windows下安卓模拟器语言检测错误null问题 #24

trainliang opened this issue Jul 8, 2021 · 3 comments

Comments

@trainliang
Copy link

更改后代码

// 获取当前用户的APP语言配置Locale类,如果为null,则语言跟随系统语言
  Locale getLocale() {
    if (_locale == null) return null;
    if (_locale.indexOf("_") > 0) {
      var t = _locale.split("_");
      return Locale(t[0], t[1]);
    } else {
      return null;
    }
  }

代码中为字符判断,会报错。

@xuexiangjys
Copy link
Owner

xuexiangjys commented Jul 8, 2021

你这不是最新代码!

cef2e22

@trainliang
Copy link
Author

我表述错误:
本意是说你代码里的null不应该是字符null
代码改成这个:
if (_locale == null) return null;

@vinurs
Copy link

vinurs commented Jul 9, 2021

我也遇到了这个问题,macos iPhone模拟器

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants