service thread 结合使用

1.启动 context.startservice  来启动service

2.service 中新建内部类 extens thread

3.重写新建内部类中的run

  run中增加循环,循环中加Thread.sleep(1000)来延迟

4.service中的onCreate中增加 新建内部类型变量的start();

原文地址:https://www.cnblogs.com/sode/p/2781688.html