Status Update
Comments
ap...@google.com <ap...@google.com> #2
As a general note, what you're checking makes little sense - onAttachFragment
is called as fragments move through their lifecycle methods (specifically, right after onAttach()
is called on the fragment) and is therefore likely to be called while FragmentTransactions are being processed - if you have multiple commit()
s in flight, the state you get back in onAttachFragment
will certainly not be the final state the FragmentManager will be when all of the FragmentTransactions are executed, making this a bit of a meaningless check.
That being said, this is caused by the mechanism used to kick off transitions when reordering is not allowed, which is being reworked in
As a workaround, you can use setReorderingAllowed(true)
on your transaction, which will allow your example project to work correctly.
Description
Component used: Fragment
Allow developers to detect the usage of
setTargetFragment()
.This would hook into calls to
setTargetFragment()
and apply the appropriate penalties if this detection was enabled.