File file=new File("file:///android_asset"+filename);
if (file.exists()) {
Uri targetUri = Uri.fromFile(file);
Intent intent1 = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(targetUri, "application/pdf");
try {
startActivity(intent1);
}
catch (ActivityNotFoundException e) {
Toast.makeText(FileWebView.this,
"No Application Available to View PDF",
Toast.LENGTH_SHORT).show();
}
質問する
1170 次