适配器&主题.对话&刷新内容

发布于 2024-09-09 15:46:37 字数 707 浏览 3 评论 0原文

有一个使用 SimpleCursorAdapter 的带有 ListView 的 Activity A,并且对于每一行,根据 SQLite 中的列结果编号,应该显示一个 ImageView。然后是 Activity B,它是带有 Theme.Dialog 的 Activity。当我打开 Activity B (通过 startActivityForResult)时,我有一些项目,选择一个项目会导致 Activity B 完成。因此,当我回到Activity A时,我可以通过LogCat看到正在调用bindView,但没有调用newView,导致ImageView无法使用新图像刷新。

我尝试在 onResume()onActivityResult() 中调用 notificationDataSetChanged(),因为当我从 Activity B 返回时都会调用这两个方法,但是什么也没发生!

因此,有一个 Activity C,它是一个常规 Activity,与 Activity B 执行相同的操作,但它不是 Theme.Dialog Activity,当我从 C 返回到 A 时, newView 被调用,因此 ImageView 被刷新! :D

我该怎么办?

Theres Activity A with a ListView using SimpleCursorAdapter and for each row, theres a ImageView that should be displayed, according to a column result number in SQLite. Then theres Activity B which is a Activity with the Theme.Dialog. When i open up the Activity B (via startActivityForResult) i have some items, selecting one item, causes the Activity B to be finished. So, when i get back to Activity A, i can see through the LogCat that bindView is being called but not newView, causing the ImageView to not be refreshed with the new image.

I've tried calling notifyDataSetChanged() in onResume() and onActivityResult(), since both are called when i get back from Activity B but nothing happens!

So, theres a Activity C which is a regular Activity that does the same thing as Activity B, but its NOT a Theme.Dialog Activity, and when i get back from C to A, newView is being called and thus the ImageView is being refreshed! :D

What should i do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱情眠于流年 2024-09-16 15:46:37

我按照自己的方式实现了FilterQueryProvider。使用 runQuery 给了我我想要的! :)

ive worked my way implementing FilterQueryProvider. Playing with runQuery gave me what i wanted! :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文