how to run application in background in android?

旧城冷巷雨未停 提交于 2019-11-27 14:16:44

问题


Hi, I want to make an Android application that continues to run in background and when user accesses any folder, picture, or any other file it notifies using toasts that he accesses this file(filename).


回答1:


The other people answering your question are focused on the "background" part, and a Service would indeed accomplish this. Users have fairly loudly stated that they despise constantly-running services like the one you are proposing.

when user access any folder or picture or any file it notify using tosts that he acess this file(filename).

For files that you can access yourself (e.g., those on external storage), you can use FileObserver class.




回答2:


Use FileObserver to detect file access or change.



来源:https://stackoverflow.com/questions/7214825/how-to-run-application-in-background-in-android

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