我使用GridView,ImageView和BaseAdapter在http://developer.android.com/guide/topics/ui/layout/gridview.html中显示80个图像作为代码。 在
gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
(code data changes)
imageAdapter.notifyDataSetChanged();
}
gridview将刷新,调用getview。但如果我这样添加一个for循环
gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
for(int i=0;i<3;i++){
(code data changes)
imageAdapter.notifyDataSetChanged();
}
}
gridview不会刷新,我发现没有调用getview。为什么?如果我想使用循环来刷新gridview,我该怎么办?