Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望我的应用程序一直运行。它应该在手机处于睡眠模式时执行一个函数,并在它睡眠时停止执行。任何人都可以发布示例代码吗?
提前致谢。
我认为您需要查看 WakeLocks http://developer.android.com/reference/android/os/PowerManager.WakeLock.html