4.上面代码中
?RecommendService.class
类的具体内容:
public class RecommendService extends IntentService? {
? ? @Override
? ? protected void onHandleIntent(Intent intent) {
? ? ? ?
? ? ? ? }
}? ?
该intentService的优势在于会按顺序执行被定时器多次启动的发送过来的intent的操作,并且耗时的intent操作不用在新建子线程,因为intentSevice已经为每个intent建立workThread。