I want to open pdf file which i have already downloaded on my sd card. But while opening that file through Intent It gives me error as No activity found to handle this intent. I want to open pdf in my application through pdf reader or any other way. Suggest me better solution to open pdf if possible.
PackageManager packageManager = getPackageManager();
Intent pdf= new Intent(Intent.ACTION_MAIN);
pdf.addCategory("android.intent.category.LAUNCHER");
pdf.setPackage("com.adobe.reader");
pdf.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
pdf.setDataAndType(Uri.fromFile(pdfPath),"application/pdf");
pdf.setData(Uri.parse( Environment.getExternalStorageDirectory().toString() + "/downloadedfile.pdf"));
Please help me with this.
Hey I found solution here it is.. I am opening it in Adobe pdf reader. If adobe reader is not installed i am redirecting to google play.