just to be clear, sender uses StartActivityForResult, and receiver uses ActivitySetResult. technically, they both work as expected.
Sender uses FileProvider to set up the Uri. Receiver receives the Uri and opens the resource. That works fine.
Receiver uses FileProvider to set up the Uri to return the image. Sender receives the intent and the Uri, BUT the exception is thrown when Sender tries to open the resource. If I return the image as a byte array (without FileProvider), there is no problem. Unfortunately, Android limits the size of the transfer buffer, so if an image is larger than 1MB, you can't use a byte array. And, of course, I can have Receiver send a regular intent to Sender with the Uri; that works. But it means not using StartActivityForResult and ActivitySetResult. If I'm using them legally, why don't they work in this case? What does the exception mean?
I'm not even sure FileProvider is the source of the exception. The last line of the exception output:
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2465)
also appears a number of times in Google searches.
If the 2 examples are run, all will be clear.