家伙嗨,如果我尝试指定字符串字符串数组我得到空指针异常.. 请给我一个解决方案..的Android阵列字符串
这里是我的代码,我在这家空指针线条大拇指[j] =标题; 的代码如下...
for (int i = 0; i < items.getLength(); i++) {
Node item = items.item(i);
NodeList properties = item.getChildNodes();
for (int j = 0; j < properties.getLength(); j++) {
Node property = properties.item(j);
String name = property.getNodeName();
if (name.equalsIgnoreCase("title")) {
try{
property.normalize();
Spanned title2 = Html.fromHtml(property.getFirstChild().getNodeValue().replaceAll("\\<.*?>", ""));
title = title2.toString();
}catch(Exception e){
Log.v("Exception",""+e);
}
thumbs[j]=title;
}
}
}
你在哪里初始化`thumbs`?你能告诉我们吗? – Cristian 2010-12-22 17:03:10