Code example for FileObserver

Methods: stopWatching

0
    } 
 
    @Override 
    public void onStop() { 
        super.onStop(); 
        mObserver.stopWatching();
    } 
 
    @Override 
    protected void onListItemClick(ListView l, View v, int position, long id) {
        super.onListItemClick(l, v, position, id);
        if (position < mFiles.size()) {
            File file = mFiles.get(position);
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.putExtra("subject", file.getName());
            intent.putExtra("body", "Build: " + Build.DISPLAY + "\n(Sent by BugReportSender)");
            intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
            if (file.getName().endsWith(".gz")) {
                intent.setType("application/x-gzip");
            } else if (file.getName().endsWith(".txt")) {
Connect your IDE to all the code out there  Get Codota for Java