Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends
i want some help from your side.
i want to read PDF in my android application.
i already put it in my sdcard for read. i get exact path of the PDF file but i can't read it it display blank screen. kindly help me to read this PDF.



thanks in advance.
Posted

Try this out
Java
private void openBook()
{
     File file = new File(mRealPath);
     Uri path = Uri.fromFile(file);
     Intent intent = new Intent(Intent.ACTION_VIEW);
     intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
     intent.setDataAndType(path, getString(R.string.application_type));
     try 
     {
         startActivity(intent);
     } 
     catch (ActivityNotFoundException e) 
     {
         Toast.makeText(FirstTab.this, 
         getString(R.string.no_application_found), 
         Toast.LENGTH_SHORT).show();
     }
}
 
Share this answer
 
there was problem of adobe reader in file so i cant read that value. i used other pdf reader to read the pdf file. so i can easily read the value. with my old code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900