Skip to content

Conversation

@vakrilov
Copy link
Contributor

PR Checklist

What is the current behavior?

Sometimes _onAttachedToWindow is called by Android after the app has suspended. Usually there is another call to _onDetachFromWindow immediately after, but on some version of android (reproduced on Oxygen 10 / OnePls 7T) there isn't. Which cause fragment manager calls too early in the lifecycle after the app is resumed and leads to crashes.

What is the new behavior?

Set the _attachedToWindow after the this._manager.isDestroyed() check to make sure it is not raised falsely.

Fixes #8104

@cla-bot cla-bot bot added the cla: yes label Dec 16, 2019
@vakrilov vakrilov changed the base branch from master to release December 16, 2019 14:56
@vakrilov vakrilov changed the title Handle fake attach fix:Handle fake attach Dec 16, 2019
@vakrilov vakrilov changed the title fix:Handle fake attach fix(android): handle fake attach Dec 16, 2019
@m-abs
Copy link
Contributor

m-abs commented Dec 16, 2019

It looks like this fixes the crash, we were experiencing.

@vakrilov vakrilov merged commit d1858f8 into release Dec 17, 2019
@vakrilov vakrilov deleted the handle-fake-attach branch December 17, 2019 06:57
vakrilov pushed a commit that referenced this pull request Jan 27, 2020
* fix the crash

* chore: update MaterialComponents pod (#8176)

* chore: update MaterialComponents pod

* chore: remove copy of pod file in build script

* chore: cut the 6.3.0 release (#8174)

* hore: cut the 6.3.1 release

* fix: handle fake attach after FragMgr is destroyed (#8200)

* fix: check is disposed fragment is in the FragmentManager (#8201)

* release: cut the 6.3.2 release

Co-authored-by: hamidbsd <50081218+hamidbsd@users.noreply.github.com>
Co-authored-by: Vasil Trifonov <v.trifonov@gmail.com>
Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
vtrifonov added a commit that referenced this pull request Feb 26, 2020
* fix the crash

* chore: update MaterialComponents pod (#8176)

* chore: update MaterialComponents pod

* chore: remove copy of pod file in build script

* chore: cut the 6.3.0 release (#8174)

* hore: cut the 6.3.1 release

* fix: handle fake attach after FragMgr is destroyed (#8200)

* fix: check is disposed fragment is in the FragmentManager (#8201)

* release: cut the 6.3.2 release

* release: cut the 6.4.0 release

* chore(build): always use local typescript

* fix: flipLeft and flipRight on Android (#8307)

* fix(android): tap-trip-item title disappearing

* fix(andoid): crash when setting font on tab-item with no image

* fix(build): Add platforms/android to NPM package (#8312)

Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
Co-authored-by: Alexander Vakrilov <alexander.vakrilov@gmail.com>

* release: cut the 6.4.1 release

* chore: bump tns-core-modules-widgets version (#8352)

Co-authored-by: hamidbsd <50081218+hamidbsd@users.noreply.github.com>
Co-authored-by: Alexander Vakrilov <alexander.vakrilov@gmail.com>
Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
Co-authored-by: Nick Iliev <nikolay.iliev@telerik.com>
Co-authored-by: Martin Bektchiev <martin.bektchiev@progress.com>
Co-authored-by: Rosen Vladimirov <rosen-vladimirov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants