Skip to content

Instantly share code, notes, and snippets.

@wendal
Created November 22, 2013 12:44
Show Gist options
  • Save wendal/7599286 to your computer and use it in GitHub Desktop.
Save wendal/7599286 to your computer and use it in GitHub Desktop.
package com.example.androx_dev;
import android.app.Activity;
import android.os.Bundle;
import android.os.FileObserver;
import android.view.Menu;
public class MainActivity extends Activity {
private FileObserver watcher;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
watcher = new RecursiveFileObserver("/mnt/sdcard", RecursiveFileObserver.CHANGES_ONLY);
watcher.startWatching();
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment