一个IntentService和服务之间的区别是什么? [英] What is the difference between an IntentService and a Service?

查看:101
本文介绍了一个IntentService和服务之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以请帮我理解的区别的 IntentService 服务是?

Can you please help me understand what the difference between an IntentService and a Service is?

推荐答案

总之,一个服务是为开发者设立后台操作更广阔的实现,而一个IntentService是有用的发射后不管作战,照顾背景线程的创建和清除。

In short, a Service is a broader implementation for the developer to set up background operations, while an IntentService is useful for "fire and forget" operations, taking care of background Thread creation and cleanup.

从文档:

服务 一个Service是一种应用程序组件重新presenting无论是应用程序的愿望,执行长时间运行的操作,而不是与用户交互或提供功能的其他应用程序使用。

Service 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.

IntentService IntentService是对于服务的处理异步请求(pssed的意图EX $ P $)需求的基类。客户端通过 startService(意向)发送呼叫请求;根据需要该服务已启动,把手又用一个工作线程的每个意图,并停止时,它本身耗尽的工作。

IntentService IntentService is a base class for Services that handle asynchronous requests (expressed as Intents) on demand. Clients send requests through startService(Intent) calls; the service is started as needed, handles each Intent in turn using a worker thread, and stops itself when it runs out of work.

这篇关于一个IntentService和服务之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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