Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为我的日历使用 baseadapter 类,它使用与数据库中的数据对应的图标填充日历。但是,我希望 getView 中的代码在用户单击日历时更新,从而立即显示一个新图标。如何在不创建 baseAdapter 类的新实例的情况下执行此操作?
这是我的 baseAdapter 类:
对于更新 ListView 和 gridView,您应该调用方法 adapter.notifyDataSetChanged。它将刷新所有可见项目。您应该在 getView() 方法中返回新视图,这取决于您的意愿。