I can not read a pdf file with my program. The code is simple but, unfortunately it does not work. thank you in advance
String path =getActivity().getFilesDir()+"/test.pdf";
File file = new File(path);
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");
startActivity(intent);