Is it possible to override File.delete() function? Whenever i delete any file from sdcard from other apps (not using by my application) i need a notification like this file is going to be delete. A sample code snippet i tried is,
public class ExtendFile extends File
{
public ExtendFile(File dir, String name)
{
super(dir, name);
// TODO Auto-generated constructor stub
}
@Override
public boolean delete()
{
System.out.println("to be deleted");
return super.delete();
}
}
and
File file = new File("/mnt/sdcard/tmp.txt");
ExtendFile f = new ExtendFile(file, tempPath);
i implemented above two statements in a service class in FileObsever. Now i deleted tmp.txt file from other app, but i didn't get any notification. How can i get the notifications from other apps ? Is it possible or not ?
Thanks in advance