Yes, I did
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
but still got exception after camera took a shot and have selected it to return back to my app.
Here is good explanation that I googled and it worked fine for me.
Mark Murphy's CommonsBlogcommonsware.com
And have a look the update at the end of the article (UPDATE 2016–09–01), I think this is an explanation of the problem that was mentioned by Egor Andreevich.