Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
>> When I create a simple intent for this purpose it's throwing exception
>> But when I use Intent with createChooser(), platform is listing different email clients available in the device and allowing me to choose an email client. When I choose Gmail, it's opening properly with proper information and a message is being displayed saying permission denied for attachment. But not throwing any exception.
versions :: targetSDKVersion : 24 run on Android 5x device with Android 7.0 OS.
Steps to Reproduce :: (android app zip file attached for reference)
>> Create an application where we create a file in cache directory from a file in assets directory.
>> In the app we have two buttons, first button try to send the cache directory file using normal intent like
"startActivity(intent);"
When we click this button, we can observe in logs that it's throwing exception FileUriExposedException.
>> In the app on second button click we are using intent with chooser like
"startActivity(Intent.createChooser(intent,"Choose"));"
When we click this button, there is no exception in the logs.
What should have happened ::
>> When we pass file:// uri with normal itnent or intent with chooser FileUriExposedException should be thrown.
Please someone explain me what is causing this discrepancy when we use chooser along with intent.