Skip to content

Instantly share code, notes, and snippets.

@reflog
Created September 22, 2010 08:47
Show Gist options
  • Save reflog/591374 to your computer and use it in GitHub Desktop.
Save reflog/591374 to your computer and use it in GitHub Desktop.
File sd = new File(Environment.getExternalStorageDirectory() + File.separator + PDFFolder + File.separator + model.get(idx));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(sd));
intent.setDataAndType(Uri.fromFile(sd), "application/pdf");
try {
getContext().startActivity(intent);
}catch(ActivityNotFoundException e){
//Show a message that PDF viewer is not installed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment