Fixed
Status Update
Comments
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #2
This is affecting CameraView as well.
ap...@google.com <ap...@google.com> #3
Bugjuggler: wait until next quarter
jb...@google.com <jb...@google.com> #4
Hi. I've received your bug and will wait until 2020-01-01 00:00 -0800 PST and then assign the bug to ericng@google.com.
Description
Component used: Activity
Version used: 1.7.2
As explained in the Predictive Back guide , you shouldn't use an
OnBackPressedCallback
for non-UI cases (for example, just for logging back). If you add a callback, you have to handle back completely in your callback.That means that calling
remove()
and triggering back viarequireActivity.onBackPressed()
oronBackPressedDispatcher.onBackPressed()
is always an anti-pattern and something that you should not do.It would be helpful if there was a Lint error that specifically catch this case and warn developers ahead of time that this is the wrong thing to do and offer alternatives or at least link to the guide for more information.