android java.lang.ArrayIndexOutOfBoundsException:length = 1;索引= 1

时间:2016-08-08 14:36:48

标签: android indexoutofboundsexception

我遇到了这个错误

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1

我的代码:

String[] web = new String[jsonArray.length()-1];
int[] imageId = new int[]{jsonArray.length()-1};
for (int i = 0; i < jsonArray.length(); ++i) {
    jo_inside = jsonArray.getJSONObject(i);
    imageId[i] = R.drawable.a1;
    web[i] = jo_inside.getString("level");
}

0 个答案:

没有答案