特定语言的Android资源$ NotFoundException

时间:2017-11-12 15:22:42

标签: android android-resources

所以基本上,我有一个拥有数千次下载的应用程序,而且有些用户(大约200个)看到他们的应用程序因此异常活动而崩溃 android.content.res.Resources$NotFoundException: at android.content.res.Resources.getStringArray (Resources.java:1391)

所以这里是代码崩溃的地方(在第二行):

int arrayId = getResources().getIdentifier(ct, "array", view.getContext().getPackageName());
String[] ctOp = getResources().getStringArray(arrayId);

我检索的数组有tools:ignore="MissingTranslation",它只在values文件夹中(例如,值-XX中没有任何内容)。

另一件事是,所有与我联系过这次事故的人都来自土耳其。

1 个答案:

答案 0 :(得分:0)

我发现了这个问题,我这样做了:

ct = ct.toLowerCase();

显然土耳其语中存在一个错误,如果你这样做,所以你需要这样做:

ct = ct.toLowerCase(Locale.ENGLISH);

toUpperCase

相同

For more information about this bug, click here