Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d173fa3b authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Possible fix to issue #3213749: NPE at...

...android.app.Fragment.startActivityForResult(Fragment.java)

Make sure to remove all pending messages when AbsListView is detached
from its window.

But...  that's not enough.

It turns out that when a fragment's views are animating away, they of
course don't get detached until after the animation is done.  However
the fragment itself is immediately destroyed, leaving its live views
still going after that.

Here's a possible solution: when fragment manager initiates an animation
on a fragment whose views are being removed, it makes note of that so
it can hold off on destroying the fragment until the animation is over.

There are a lot of interesting race conditions here, if further operations
happen on the fragment while it is being animated.  I think the code here
does something sensible, and it does seem to work for the situations I
have tested, but it is hard to know all of the edge cases that may happen.

Change-Id: I4490ce8862a9bb714c7ea54baca3072c62126388
parent 7d4b0062
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment