Android - PDF Viewer

Android - PDF Viewer

Sep 1, 2010. | By: pluulove

private File pdf = null;
private final String PDF_PATH = "/sdcard/download/B.pdf";
private Intent intent;

@Override
protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.pdf);
   pdf = new File(PDF_PATH);
   if(pdf.exists() && pdf.isFile() && pdf.canRead()){
      intent = new Intent(Intent.ACTION_DEFAULT);
      intent.setType("application/pdf");
      intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(Environment.getExternalStorageDirectory() + PDF_PATH));

      startActivity(intent);
   }
}

comments powered by Disqus

Currnte Pages Tags

Android PDF

About

Pluu, Android Developer Blog Site

이전 블로그 링크 :네이버 블로그

Using Theme : SOLID SOLID Github

Social Links