carrobe1390
10/09/13, 05:07:32
Tengo el sgte codigo que es para el abrir un pdf en android
final String filename ="Factura.pdf";
File file = new File(Environment.getExternalStorageDirectory().get AbsolutePath() +"/"+ filename);
Intent target = new Intent(Intent.ACTION_VIEW);
target.setDataAndType(Uri.fromFile(file),"application/pdf");
target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
Intent intent = Intent.createChooser(target, "Open File");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
// Instruct the user to install a PDF reader here, or something
}
}
Por ultimo me sale la ruta de acceso al documento no es valida?
Alguien me podria decir que es lo que estoy haciendo mal...
:-)X-D
final String filename ="Factura.pdf";
File file = new File(Environment.getExternalStorageDirectory().get AbsolutePath() +"/"+ filename);
Intent target = new Intent(Intent.ACTION_VIEW);
target.setDataAndType(Uri.fromFile(file),"application/pdf");
target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
Intent intent = Intent.createChooser(target, "Open File");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
// Instruct the user to install a PDF reader here, or something
}
}
Por ultimo me sale la ruta de acceso al documento no es valida?
Alguien me podria decir que es lo que estoy haciendo mal...
:-)X-D