摘要: Android系统在用户长时间不操作时,为了节省资源,系统会选择休眠。在休眠过程中自定义的Timer、Handler、Thread、Service等都会暂停。而有时候这种机制会影响到我们程序的正常运行。那如何避免系统休眠对我们程序的影响呢? 以下已Service服务为例说明在系统休眠的状态下如... 阅读全文
posted @ 2015-05-26 11:09 小寻 阅读(7792) 评论(0) 推荐(0) 编辑
摘要: 一、先说Service服务。 1、利用setAction()方法来指定启动的Service服务1 Intent intent = new Intent();2 intent.setAction("ServiceAction");3 startService(intent); 2、使用Intent... 阅读全文
posted @ 2015-05-26 10:27 小寻 阅读(2402) 评论(0) 推荐(0) 编辑