空指针异常报错
本人是新手,如图所示报错,空指针异常。
通过debug断点调试发现下方红色代码区域无法执行,希望高手能帮忙看看。谢谢
for(Iterator<Mp3Info> iterator = mp3Infos.iterator();iterator.hasNext(); ){
Mp3Info mp3Info = iterator.next();
HashMap<String,String> map = new HashMap<String, String>();
map.put("mp3_name", mp3Info.getMp3Name());
map.put("mp3_size", mp3Info.getMp3Size());
list.add(map);
}
SimpleAdapter adapter1= new SimpleAdapter(this, list, R.layout.mp3_infoitem, new String[]{"mp3_name","mp3_size"},
new int[]{R.id.mp3_name,R.id.mp3_size});
setListAdapter(adapter1);
android 异常 指针 java iterator
[解决办法]
mp3Infos = null ?
[解决办法]