适配器&主题.对话&刷新内容
有一个使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我按照自己的方式实现了
FilterQueryProvider
。使用runQuery
给了我我想要的! :)ive worked my way implementing
FilterQueryProvider
. Playing withrunQuery
gave me what i wanted! :)