Skip to content

IntentService源码分析

cheyiliu edited this page Dec 3, 2015 · 1 revision

实现思路

  • thread + handler
  • 暴露唯一接口onHandleIntent给子类实现
  • 消息队列保证任务的顺序性
  • 巧妙的自动退出机制,其关键点

Stop the service if the most recent time it was started was startId.```

startId is A unique integer representing this specific request to start.
Use with {@link #stopSelfResult(int)}.```

Clone this wiki locally