0

I have tried the solution here.

I used the solution but It gives FileUriExposedException on my galaxy s9 Plus.

From what I can tell I need to use androids file provider. Does anyone have an example in Delphi to send an intent to open an image in the default android gallery app, using file provided?

Subin Babu
  • 1,515
  • 2
  • 24
  • 50
grant1842
  • 357
  • 1
  • 7
  • 23
  • Refer this: If your targetSdkVersion >= 24, then we have to use FileProvider class to give access to the particular file or folder to make them accessible for other apps. We create our own class inheriting FileProvider in order to make sure our FileProvider doesn't conflict with FileProviders declared in imported dependencies as described here. https://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed/#38858040 – Pradip Tilala Feb 04 '19 at 05:41
  • Which version of Delphi are you using? – Dave Nottage Feb 04 '19 at 09:19
  • Delphi community 10.3 rio – grant1842 Feb 04 '19 at 15:39
  • I have looked through C:\Program Files (x86)\Embarcadero\Studio\20.0\source\rtl\android and found `JFileProvider` defined in `Androidapi.JNI.Support.pas`. Of course, this means you will have to use a Java answer as a guide to coding the solution in Delphi. That is not a trivial exercise. – Freddie Bell Feb 05 '19 at 07:37
  • I now have the answer to this question, but I don't have the reputation to request that it be opened again. What should I do? – Freddie Bell Feb 05 '19 at 13:03
  • I am still trying to figure it out. The xml solution is not working – grant1842 Feb 05 '19 at 16:20
  • @nolaspeaker Is it possable for me to ask you to post your andswer here in the comments – grant1842 Feb 05 '19 at 22:38
  • I already answered the question in a following question here (https://stackoverflow.com/questions/54535225) – Freddie Bell Feb 06 '19 at 05:14

0 Answers0