【发布时间】:2013-08-08 18:53:31
【问题描述】:
java.lang.NullPointerException
它在我的嵌套数组中。基本上我想在arrayIWantThisCat中检索
[10 {1,2,3,4} , 20 {5,6,7,8}]
String[][] arrayIWantThisCat;
String[] arrayAddendAmounts;
try {
SQLiteAdapter info = new SQLiteAdapter(this);
info.open();
alAddends = info.getFinalCategorysTagAddend();
info.close();
// Array holds all unique Addend amounts
arrayAddendAmounts = alAddends.toArray(new String[alAddends.size()]);
} catch (SQLiteConstraintException e) {
Log.d("TAG", "failure to get data,", e);
return;
}
int numberOfAddends = arrayAddendAmounts.length;
for (int i = 0; i < numberOfAddends; i++) {
try {
SQLiteAdapter info = new SQLiteAdapter(this);
info.open();
alWhatCatDoYouWant = info.getFinalCategorysCatIDsBasedOnAddend(arrayAddendAmounts[i]);
info.close();
***// This is where the issue is ( Nested Array )***
arrayIWantThisCat[i] = alWhatCatDoYouWant.toArray(new String[alWhatCatDoYouWant.size()]);
} catch (SQLiteConstraintException e) {
Log.d("TAG", "failure to get data,", e);
return;
}
}
【问题讨论】:
-
这些是你那里的一些沉重的变量/方法名称:p
info.getFinalCategorysCatIDsBasedOnAddend(arrayAddendAmounts[i]);让我的大脑有点扭曲 -
为清楚起见,我建议您发布整个堆栈跟踪。然后人们将确切地知道您的
NullPointerException出现在哪里,以及也许为什么。 -
对不起。我用 // 这就是问题所在(嵌套数组) 标记了它
标签: java android sqlite nullpointerexception