1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| for(int i=0;i<tab_chaine.size();i++){
File file = new File("/sdcard"+
"/dossier/"+tab_chaine.get(i));
//new ToastMessageTask().execute("on a demandé de telecharger ce path"+tab_chaine.get(i));
status =ftpDownload("/dossier/"+tab_chaine.get(i),Environment.getExternalStorageDirectory()+
"/dossier/"+tab_chaine.get(i));
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
// optionnel a toi de voir quel flag tu souhaites
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//new ToastMessageTask().execute("on a demandé une nouvelle fenetre adobe reader");
try {
startActivity(intent);
Log.i("adobe ","on a demandé d'aaficher le document " );
}
catch (ActivityNotFoundException e) {
Log.e("intent dobe ", e.getMessage());
}
} |
Partager