FIleObserver and ContentObserver not working in Android Marshmallow

眉间皱痕 提交于 2019-12-01 03:57:20

This appears to be a bug in Marshmallow, see here.

You can only try working around it by polling for whatever information you need.

How well this will work for you depends on your use case. I found it usable for tracking download progress: start polling when the download starts, with a one-second interval, and stop when the download finishes.

If you expect very infrequent changes, you can try increasing the interval – at the cost of a potentially higher delay between changes happening and your app picking them up.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!