How to refresh a GridView?

后端 未结 9 2294
清歌不尽
清歌不尽 2020-12-01 08:01

I have a GridView which is pretty similar to the Google tutorial, except that I want to add the ImageViews on runtime (via a subactivity). The results are okay, but the layo

9条回答
  •  再見小時候
    2020-12-01 08:06

    You must, first tell the adapter to notify that the data has changed and set the adapter again to the grid

    adapter.notifyDataChanged();
    grid.setAdapter(adapter);
    

提交回复
热议问题