Does android provide any built 开发者_运维知识库it control like video view or image view to display pdf ebook?
More specifically I want to open a pdf ebook in android with following controls on the screen.
- zooming controls
- turn over functionality/swipe to change page.
What is the suitable way to achieve this?
Android does not provide a default PDF reader. I believe some phones come with a pre-installed application for reading PDFs, but you cannot rely on this fact for all devices. The best you can do for now is choose to open the user's default PDF reader (if they have one installed).
Use an intent to open up the user's default PDF app (untested, should be something like this):
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(pathToPDF, "application/pdf");
startActivity(intent)
精彩评论