Skip to content

Instantly share code, notes, and snippets.

@Gopinathp
Created October 10, 2012 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gopinathp/3863340 to your computer and use it in GitHub Desktop.
Save Gopinathp/3863340 to your computer and use it in GitHub Desktop.
On any typical android activity, in which you want to have copy app private files to sdcard, wire the Common.java code to handle the file copying
private static final int MENU_COPY_FILES = 99;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_kid_feed, menu);
if (BuildConfig.DEBUG) {
menu.add(Menu.NONE, MENU_COPY_FILES, Menu.NONE, "Copy App Files to sdcard");
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_COPY_FILES:
Common.handleCopyFilesToSdCard(App.getContext());
break;
default:
break;
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment