我正在進行sax XML解析。java.lang.IndexOutOfBoundsException:索引11無效,大小爲11
logcat的錯誤,如...
java.lang.IndexOutOfBoundsException: Invalid index 11, size is 11
我在
map.put("pubdate", sitesList.getPubdate().get(i));
for (int i = 0; i < sitesList.getName().size(); i++) {
System.out.println("value of i==============>"+i);
HashMap<String, String> map = new HashMap<String, String>();
System.out.println("\nvalue of title==============>"+ sitesList.getName().get(i));
map.put("title", sitesList.getName().get(i));
map.put("pubdate", sitesList.getPubdate().get(i));
map.put("desc", sitesList.getDesc().get(i));
items.add(map);
}
謝謝大家得到了錯誤。
在11處沒有一個。除此之外,我們猜測,因爲我們看不到xml。 –
你確定知道'getPubDate'與'getName'具有相同的大小嗎? – assylias