How to click OK button in android device after taking a picture?

In order to take a picture in android device i use the following code:

If I want to save the picture then I need to click on OK button.
I can click on the OK button using id, but the thing is that in every phone I have a different id. I run my tests on aws device farm, and since I don’t know on which device the code will run, is there a way to press OK on every android device my code will run?
A KEY_CODE or something like that?


maybe you can try to use find_element_by_android_uiautomator(“new UiSelector().text(%s)”) method.
it works to me.