Androidでごみ箱アプリケーションを実装しようとしてFileObserver
います.クラスに出くわしてすべてのファイルを観察しましたが、問題はFileObserver
ファイルの削除後にファイルが削除されたことを通知するだけです.ここに私のコードスニペットがあります
public void onEvent(int event, String path) {
if (path == null) {
return;
}
//File was deleted from the monitored directory
if ((FileObserver.DELETE & event)!=0) {
//Here I want to copy File some where else then I am getting
//'File Not found exception' because file is already
// deleted before reaching this point of code
}
}
このなぞなぞを解決するために、どなたか知識を共有してください。この種のRecycle Bin
質問は、ここや他のサイトでも何度も尋ねられていstackoverflow
ますが、まだ適切な解決策はありません.
にはアプリケーションがありGoogle Play
、そのアプリケーションの名前はDumpster
、タスクを達成しているアプリケーションです。
私を助けてください。
前もって感謝します。