Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File file = new File("android.resource://[package]/[res id]");
- Intent target = new Intent(Intent.ACTION_VIEW);
- target.setDataAndType(Uri.fromFile(file),"application/pdf");
- target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
- Intent intent = Intent.createChooser(target, "Abrir pdf");
- try {
- startActivity(intent);
- } catch (ActivityNotFoundException e) {
- Toast.makeText(this, "e.toString()", Toast.LENGTH_LONG).show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement