Skip to content

Instantly share code, notes, and snippets.

View itechsyst's full-sized avatar

Pranav itechsyst

View GitHub Profile
1. create assets folder in src under your app name.
2. In this assets folder keep your pdf files e.g. file.pdf.
3 now come your activity i.e MainActivity.java
4. setListener on any UI component what you want i.e (Button,ImageView,ImageButton);
5. In this listener call one user defined method i.e. openPDFFiles("file.pdf");
the openPDFFiles() method have below code:—-
private void openPDFFiles(String fileName) //fileName is the pdf file name which is keep in assets folder. ex file.pdf
{