Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Last active May 15, 2018 10:36
Embed
What would you like to do?
private void allowPermissionsIfNeeded() {
if (Build.VERSION.SDK_INT >= 23) {
UiObject allowPermissions = mDevice.findObject(new UiSelector().text("Allow"));
if (allowPermissions.exists()) {
try {
allowPermissions.click();
} catch (UiObjectNotFoundException e) {
Timber.e(e, "There is no permissions dialog to interact with ");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment