【发布时间】:2011-06-23 08:02:48
【问题描述】:
我使用LocationManager.addProximityAlert(double latitude, double longitude, float radius, long expiration, PendingIntent intent) 函数编写了一个基于位置的应用程序,这正是我想要的。但在那之后,在我的设备(Samsung Galaxy S)上,该应用程序会在几个小时后显示在电池使用视图的顶部,并且有很长一段时间处于“保持清醒”状态。在使用该 api 之前,我使用了“requestLocationUpdates(String provider, long minTime, float minDistance, PendingIntent intent)”,并且该应用程序没有出现在电池 Usage-Stat 中(至少没有那么多)。
我没有启动任何服务或任何其他后台任务/线程。
那是为什么呢?如何减少“保持清醒”期?
【问题讨论】:
标签: android sleep locationmanager power-management