2

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、タスクを達成しているアプリケーションです。

私を助けてください。

前もって感謝します。

4

0 に答える 0