In my app i download pdf file from url and open this pdf with chooser. The opened file canot be shared.
This is the code i used to open pdf files.
File file = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DOWNLOADS).toString()+"/oferte/oferta"+insertedid+".pdf");
File(getApplicationContext().getFilesDir().toString()+"/oferta"+idfactura+".pdf");
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);
finish();
} catch (ActivityNotFoundException e) {
}