I use the following code to open a pdf form. If I use Acrobat Reader it's not possible to write back to the original file. It always makes a copy which I only could guess but newer know for shure in my app.
I know that it has to be possible to edit the original because if I open a pdf from any file manager (e.g. the one from Asus) Adobe Reader edits it directly.
Xodo PDF allows direct edit. It even supports the correct ACTION_EDIT intent but I'm afraid that our users insist to use Adobe...
How can I edit the original with Adobe?
final File file = new File(Environment.getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS) + File.separator + "x.pdf");
if(file.exists())
{
file.setWritable(true,false);
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri contentUri = FileProvider.getUriForFile(Objects.requireNonNull(getContext()),
BuildConfig.APPLICATION_ID + ".fileprovider", file);
intent.setDataAndType(contentUri,"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY|Intent.FLAG_GRANT_WRITE_URI_PERMISSION|Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent = Intent.createChooser(intent, "Open File");
startActivity(intent);
}