一旦内容提供商的更新,我怎么能告诉所有监听器有一个更新? [英] Once a Content provider is updated, how can I inform all listeners there was an update?

查看:89
本文介绍了一旦内容提供商的更新,我怎么能告诉所有监听器有一个更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨基本上我有一个表,这个表正从我写了一个内容提供商的信息。如果我更新内容供应商我怎么能强迫当数据在内容提供商改变的UI更新?

Hi basically I have a table, this table is getting information from a content provider I wrote. If I update a content provider how can I force an update on the UI whenever the data is changed in the content provider?

例如:
如果列表被显示
一个

FOr example: If a list is showing A B

和我添加C到内容提供商

and I add C to the content provider

我怎么能得到用户界面,显示
一个

C
只要它更新?或者它会自动播放任何改变我吗?

how can I get the UI to show A B C as soon as it updates? Or does it automatically broadcast any changes for me?

推荐答案

查看后,该谈的内容观察员。我会说听的变化,当一个发生更新列表。由于您的应用程序是一个做插入(尽管其他人可能也一样),你可以只插入一条记录后更新列表。

Check out this post, which talks about content observers. I would say listen for changes, when one occurs update your list. Since your application is the one doing the inserting (although others may as well), you could just update your list after inserting a record.

这篇关于一旦内容提供商的更新,我怎么能告诉所有监听器有一个更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆