Dear friends, I’m facing a problem in my app with permissions.
I have an app that when the user clicks a button, the app call the camera to take a picture. When the picture is taken, this picture should replace the button old picture.
But only in THE FIRST launch of the app, android asks for permition to access photos media and files, AFTER the picture is taken, so when I agree the access I can’t replace the button old picture without taking the photo again.
I would like to ask this permission before taking the photo. How can I do it?
Dear samiu8336, the blocks works fine, but the problem is the timing between taking the picture and the application asking for permission.
As the logic is saying, I take the picture, after that when the code tries to set the button1.image the first time the app is running, the app “sets” the image without the permission, so I get a grey image over the button. And after that, the android system asks me about the permission.
it should have some manner to force the android to ask the permition before I take the picture, understand?