You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/08/14 07:33:36 UTC

[GitHub] subashdbc opened a new issue #478: Open PDF with Adobe Acrobat from Cordova

subashdbc opened a new issue #478: Open PDF with Adobe Acrobat from Cordova
URL: https://github.com/apache/cordova-android/issues/478
 
 
   I have a pdf file which can be edited through Adobe Acrobat. When I open the file straight away from Adobe Acrobat app and edit the file, and when I press the back button it gets saved automatically by Adobe Acrobat app, but when I open from Cordova application, it is opening with Adobe Acrobat app and I can also able to edit that, but when press the back button and come back to app, and once again hit the pdf file from the Cordova app, it is not showing the edited content (it happens only with above android 7 versions, but below android version 7 it is working fine from the app).
   
   I open the file with this code from Cordova,
   ```
   Uri path = Uri.fromFile(file);
   
   PackageManager packageManager = this.cordova.getActivity().getPackageManager();
   
   String application_id = "com.package.name";
   
   try {
   
         PackageInfo packageInfo = packageManager.getPackageInfo(
   
         this.cordova.getActivity().getPackageName(), 0);
   
         application_id  = packageInfo.packageName
   
   } catch (NameNotFoundException e1) {
   
          e1.printStackTrace();
   
   }
   
   if (Build.VERSION.SDK_INT >= 24) {            
   
          path = FileProvider.getUriForFile(this.cordova.getActivity(), application_id + ".provider", file);
   
   }
   
   Intent intent = new Intent(Intent.ACTION_VIEW);
   
   intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
   
   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   
   intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
   
   intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
   
   intent.setDataAndType(path, contentType);
   
   cordova.getActivity().startActivity(intent);
   ```
   Does it need any extra permission from the application or any other way? Thanks in advance!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org