【发布时间】:2013-04-16 16:39:58
【问题描述】:
我的应用程序有许多片段,其中许多片段从 ListFragment 扩展而来,并具有用于读取数据库 (SQLite) 的适配器。我的应用只有一个 Activity(目前),并且在 Activity 启动时绑定了一个 Service。
我的问题是如何在服务或其他片段的数据库发生更改时通知片段。
我的应用程序架构示例
MainActivity
tabhost
fragment
listfragment
listfragment
fragment
fragment
gridfragment
fragment
MainService
comunication_server
send_data
receive_data
如您所见,我的应用程序有几个片段,我想通知片段数据已更改。或者至少启动一个内部广播可以被iNotifyPropertyChange .NET C#/WPF之类的片段听到
【问题讨论】: