Monday 26 August 2013

How to open a PDF via Intent from SD card



Here simple Intent call that use to open pdf Documents from our app.

                           File file = new File(Environment.getExternalStorageDirectory()
                                         .getAbsolutePath() + "/droidText/mysample.pdf");
                           Intent intent = new Intent(Intent.ACTION_VIEW);
                           intent.setDataAndType(Uri.fromFile(file), "application/pdf");
                           intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);

                           startActivity(intent);

I hope this will help you 
Happy codddding :) 

No comments:

Post a Comment