草庐IT

WakefulIntentService

全部标签

java - Android:如何知道Commonsware 的WakefulIntentService 是否在运行?

我有一个简单的问题:我在我的应用程序中使用了commonsware的wakefulintentservice并且我让它工作了,但是我怎么知道WakefulIntentService是否仍在运行?例如,我可以在WakefulIntentService类中放置一个onDestroy并让它记录一些东西,还是有其他方法可以查看WakefulIntentService是否正在运行?提前致谢! 最佳答案 I'musingcommonsware'swakefulintentserviceinmyapplicationandIgotitworkin

android - WakefulIntentService 实现说明

Commonsware的WakefulIntentService效果很好,但有些东西我不太明白。下面是该服务的核心-source的精简版:classWISextendsIntentService{privatestaticfinalStringNAME=WIS.class.getName()+".Lock";privatestaticvolatileWakeLocklockStatic=null;synchronizedprivatestaticPowerManager.WakeLockgetLock(Contextcontext){if(lockStatic==null){Power