在碎片管理服务/应用程序选项卡 [英] Managing Service in fragments/tab application

查看:111
本文介绍了在碎片管理服务/应用程序选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用三个标签,每三个片段,我想为我的应用程序开始启动该服务,但我只想更新​​我的片段之一,请给我的想法如何做到这一点,什么时候开始服务以及如何把广播接收器来更新片段,这样,当它含有标签甚至不开片段得到更新?由于提前

I have three tabs in app and three fragments each and I want to start the Service as my app is started but I want to update only my one of the fragment ,Please give me the idea how to do this, when to start the Service and how to put the broadcast receiver to update the fragment so that fragment get updated when its containing tab is even not open? Thanks in Advance

推荐答案

您可以写要更新自己的片段接收器。片段与活动相似的生活cicyle。

You can write the receiver in your own Fragment which you want to update. Fragment has the similar life cicyle with Activity.

这篇关于在碎片管理服务/应用程序选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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