Reputation: 7759
I work with Android and I want to open PDF file:
Can somebody help me?
Upvotes: 0
Views: 9028
Reputation: 3999
Assuming there is a PDF viewer application installed on the device
To open the PDF in application use:
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
where file is the path of PDF File.
Upvotes: 3