So my Question is to know if ContentObserver can be used to Monitor a Folder and get Notified when a file is Created/Removed ?

in my Case , i want to Monitor the Camera Folder and get Notified when a new file is Created (Picture Taken) ,

Thanks .

有帮助吗?

解决方案

So my Question is to know if ContentObserver can be used to Monitor a Folder and get Notified when a file is Created/Removed ?

No.

in my Case , i want to Monitor the Camera Folder and get Notified when a new file is Created (Picture Taken)

You can either use a ContentObserver with MediaStore to find out when any images are added or removed, or you can use FileObserver to monitor the standard path to pictures on external storage.

Neither of these will necessarily reflect "Picture Taken", as camera apps do not have to store their images in that specific folder, nor do they have to have their images indexed by MediaStore.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top