-
-
Save KaustubhPatange/969e57f69d3d2cc7e37fc3b6d9d5fa7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OnBackPressedDispatcher ... { | |
... | |
@MainThread | |
public void onBackPressed() { | |
Iterator<OnBackPressedCallback> iterator = | |
mOnBackPressedCallbacks.descendingIterator(); | |
while (iterator.hasNext()) { | |
OnBackPressedCallback callback = iterator.next(); | |
if (callback.isEnabled()) { | |
callback.handleOnBackPressed(); | |
return; | |
} | |
} | |
if (mFallbackOnBackPressed != null) { | |
mFallbackOnBackPressed.run(); | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment