-1

I'm new in android development so I know how to open pdf from assest folder file by using some of the available API .

But how can I make for any pdf means like adobe reader.

Rajan Maurya
  • 624
  • 1
  • 12
  • 24

1 Answers1

0

If you would like to open Adobe Reader (with a version) specifically from your app, you need to query it using PackageManager.getPackageInfo(String, int)!

You can also try the following code,

private void loadDocInAdobeReader(String someDoc)
     throws ActivityNotFoundException, Exception {

    try {
                Intent intent = new Intent();
                intent.setPackage("com.adobe.reader");
                intent.setDataAndType(Uri.parse(someDoc), "application/pdf");
                startActivity(intent);

    } catch (ActivityNotFoundException ae) {
                ae.printStackTrace();
                throw ae;
    } catch (Exception e) {
                e.printStackTrace(); 
                throw e;
    }
}
Naveen
  • 1,040
  • 4
  • 15
  • 38