傢伙嗨,如果我嘗試指定字符串字符串數組我得到空指針異常.. 請給我一個解決方案..的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