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();
}
Asked
Active
Viewed 1,175 times
1

Hans Hohenfeld
- 1,729
- 11
- 14

bkshukla
- 179
- 5
- 19
-
Please check this [link][1] . You can use google doc viewer. [1]: http://stackoverflow.com/a/8240737/614807 – Chirag Jul 31 '12 at 07:41
-
Could you please provide a little more information, i.e. how that the code in the activity look, that handles the Intent, what exactly happens, do any error occur, logcat output (if there are some messages related to this) etc. – Hans Hohenfeld Jul 31 '12 at 07:42
-
its showing blank screen without any error.. – bkshukla Jul 31 '12 at 08:31