Skip to content

Instantly share code, notes, and snippets.

@xqdzn
Last active December 16, 2015 01:49
Show Gist options
  • Save xqdzn/5358041 to your computer and use it in GitHub Desktop.
Save xqdzn/5358041 to your computer and use it in GitHub Desktop.
@Override
public void onClick(View v) {
File file = new File(Environment.getExternalStorageDirectory()
+ File.separator + "Floccus" + File.separator + sName);
Log.e("openButton: ", "Clicked");
Log.e("filename: ", file.toString());
Uri uri = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
// I use plain/text just for testing. Will parse it later.
intent.setDataAndType(uri, "plain/text");
context.startActivity(intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment