My assets folder :
Intent intent = new Intent(this, MyPdfViewerActivity.class);
intent.putExtra(MyPdfViewerActivity.EXTRA_PDFFILENAME, "PDF FILE PATH");
startActivity(intent);
How do I get path?
Try use:
Intent intent = new Intent(this, MyPdfViewerActivity.class); intent.putExtra(MyPdfViewerActivity.EXTRA_PDFFILENAME, "file:///android_asset/xy.pdf"); startActivity(intent);
Try this
Uri path = Uri.parse("file:///android_asset/about.pdf");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);