IntentService源码分析
2015-12-03 18:22
411 查看
实现思路
thread + handler暴露唯一接口onHandleIntent给子类实现
消息队列保证任务的顺序性
巧妙的自动退出机制,其关键点
stopSelf(int startId), Stop the service if the most recent time it was started was <var>startId</var>.
onStartCommand(Intent intent, int flags, int startId), startId is A unique integer representing this specific request to start. Use with {@link #stopSelfResult(int)}.
相关文章推荐
- delegate基于on
- 如何让textField的输入框只能输入特定字符
- 标准体重输出代码
- uwsgi 启动脚本 每隔三小时重启
- OC基础(17)
- 基于egret引擎、P2物理库的搭积木游戏
- Android出现Immutable bitmap passed to Canvas constructor错误的原因
- scst target在设置开机自启动时所遇问题的原因及解决办法
- Centos下python安装 MySQLdb报错
- 基础
- 实现在GET请求下调用WCF服务时传递对象(复合类型)参数
- Android快捷方式解密
- Android设置Settings实现:PreferenceActivity
- Atom插件安装及推荐
- android微信分享到朋友圈 图片过大闪退
- 2015年人力资源管理十大新趋势
- js制作日历,获取月份内有多少天。
- android ant多渠道混淆打包
- VS2010创建和使用COM组件
- Git学习笔记与IntelliJ IDEA整合 - MrJun