Is it possible to get notification when the content of a regular file is changed


Last Updated:

  1. websurf

    websurf New Member This Topic's Starter

    Joined:
    Mar 13, 2009
    Messages:
    3
    Likes Received:
    0
    As the title, when the content of any regular file is changed, is it possible to get notification?

    Thanks.
     

    Advertisement
  2. deepdroid

    deepdroid Member

    Joined:
    Feb 27, 2009
    Messages:
    15
    Likes Received:
    0
    I think you are looking for android.os.FileObserver.
    You implement a subclass of it, which implements onEvent().
    Then you construct a new instance of this class with the file path and maybe flags as parameters. After calling startWatching() your callback should be invoked with file changes.

    --
    deepdroid
     
  3. websurf

    websurf New Member This Topic's Starter

    Joined:
    Mar 13, 2009
    Messages:
    3
    Likes Received:
    0
    Thanks for you replay, I ever tried FileObserver, it only can monitor the registered file or files just under the registered path, But I want to monitor the files under the registered path RECUSIVELY.
     

Share This Page

Loading...