2
我的应用程序有一个扫描蓝牙设备的服务。 此扫描由U.I.控制。 一旦开启,它会无限期地继续,但需要隐式间歇以节省电量。我该怎么办? : 1)使用sleep()的while循环的AsyncTask; 2)ScheduledExecutorService 3)Handler 4)Alarm + Bound Service +广播接收机 还是什么? P.S. - 间隔时间可能从几秒到1小时不等。如何在android中以小间隔定期运行后台服务?
使用setInexactRepeating使用[Alarm Manager](http://developer.android.com/reference/android/app/AlarmManager.html#setInexactRepeating(int,%20long,%20long,%20android.app.PendingIntent)) (......) –