How to refresh a GridView?

后端 未结 9 2313
清歌不尽
清歌不尽 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:24

    adapter.notifyDataChanged();
    

    may not works just because data for the adapter is stale (if Activity or fragment was not destroyed and have been sitting in the back stack for instance).

    So, if firstly refresh data, then after it will be working.

提交回复
热议问题