android - how to view the pdf file in my emulator -


i have download pdf files in sdcard when click them open in emulator gives toast

"cannot open file" please me read pdf file .... please tell me wrong in code.....

file file=new file("/sdcard/android.essentials.pdf");  if (file.exists())  { 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); try {    startactivity(intent);    finish(); } catch (activitynotfoundexception e) { toast.maketext(pdffileactivity.this, "no application available view pdf",  toast.length_short).show();  } 

to launch intent on pdf file, mobile device should have installed program can read pdf documents.

if not want user have pdf reader's installed, must modify application able read pdf documents.

on post talk pdf libraries android: android : there free pdf library android


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -