浅谈service和activity通信

首先我们谈谈涉及到的几个类和方法
service:HostApduService is a convenience Service class that can be extended to emulate an NFC card inside an Android service component. IntentService IntentService is a base class for Services that handle asynchronous requests (expressed as Intents) on demand. MediaRouteProviderService Base class for media route provider services. NotificationListenerService A service that receives calls from the system when new notifications are posted or removed. OffHostApduService

OffHostApduService is a convenience Service class that can be extended to describe one or more NFC applications that are residing off-host, for example on an embedded secure element or a UICC. PrintService

This is the base class for implementing print services. RecognitionService This class provides a base class for recognition service implementations. RemoteViewsService The service to be connected to for a remote adapter to request RemoteViews. SettingInjectorService Dynamically specifies the summary (subtitle) and enabled status of a preference injected into the list of app settings displayed by the system settings app

For use only by apps that are included in the system image, for preferences that affect multiple apps. SpellCheckerService SpellCheckerService provides an abstract base class for a spell checker. TextToSpeechService Abstract base class for TTS engine implementations. VpnService VpnService is a base class for applications to extend and build their own VPN solutions. WallpaperService A wallpaper service is responsible for showing a live wallpaper behind applications that would like to sit on top of it. 摘自android api
说了个啥 我也没太懂 啥nfc啥的提供啥遍历 大概意思就是从那演变过来的吧(要不是我一本正经地胡说八道 我都信了) 为啥粘在这 不然不知道怎么开头啊
接下来才是重点
A Service is an application component representing either an application’s desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use. Each service class must have a corresponding declaration in its package’s AndroidManifest.xml. Services can be started with Context.startService() and Context.bindService().
啥意思 意思就是说 一个service是一个应用程序的组件也可以说是一个程序想要长时间的操作相互影响用户和支持的函数对于其他的应用程序使用 巴拉巴拉巴拉 。。。
下面我们来谈一下怎么实现service和activity通信
我们从启动service来说 众所周知 一般activity启动service有两种方式 一种是使用调用startservice方法 像这样

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值