wifiLock and wakeLock not working correctly on Android

前端 未结 3 1527
[愿得一人]
[愿得一人] 2020-12-20 23:06

I am developing an app that needs to use both wifiLock and wakeLock so the audio streaming when the screen is off does not get disturbed. I have tried my app on Android 2.3

3条回答
  •  温柔的废话
    2020-12-20 23:36

    You are acquiring the lock in an activity and when your activity goes in the stack the system can remove and destroy your activity and this maybe the cause of your problem. Try to acquire the lock in a service. But the combination of PARTIAL lock and WIFI does not work properly on some devices as well see this question: Android WifiLock not working?

提交回复
热议问题