brian
brian

Reputation: 6912

How to read PDF file with url in Android

My Code is :

File file = new File(docpath);
String mimetype = "application/pdf";

Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

startActivity(intent);

If I want to use the application/pdf method What should I do?

Upvotes: 1

Views: 1840

Answers (1)

Andrew T.
Andrew T.

Reputation: 2108

PDFs are not naturally supported in android. You will need to use an open source library.

Android PDF Viewer, for example. http://code.google.com/p/apv/

Upvotes: 1

Related Questions