hi...
I use FileProvider.
I just want to send it with WhatsApp. I tried setComponent.
I could not. Where am I making mistakes. Thank you.
B4X:
'copy the file to the shared folder
File.Copy(File.DirAssets, "b4a.png", Starter.shared, "b4a.png")
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
in.SetType("text/plain") 'it is not related to the file itself.
in.SetComponent("com.whatsapp")
in.PutExtra("android.intent.extra.STREAM", CreateFileProviderUri(Starter.shared, "b4a.png"))
in.Flags = 1
StartActivity(in)
You cannot guess the component name. Either remove it and let the user choose the app or search Whatsapp documentation and see whether it is documented somewhere.
In this library, the file is copied to the device. I do not want her to copy it to the device. The file provider sends it to the device without copying it.
How can I get it back when I copy it to the device? Delete it from the device when the user sends the file.
The dirassest folder is private and can only access the app. You can not link a file to this folder for external use. You could copy it to DirDefaultExternal, but it is usually not recommended. The best solution is what you found., Create a folder on DirRootExternal and after the gates.