Using rc version and @nativescript/core i am facing an issue with modal views.
To counter that isssue #7744 i need to wrap my modal views inside a Frame
Something like this
<Frame>
<Page actionBarHidden ref="page">
<StackLayout class="page" height="100%">
</StackLayout>
</Page>
</Frame>
But now it crashes on Android when closing the modal with this error:
System.err: Error: java.lang.IllegalStateException: Cannot remove Fragment attached to a different FragmentManager. Fragment fragment2[2]<Page(65)> is already attached to a FragmentManager.
System.err:
System.err: StackTrace:
System.err: Frame.disposeCurrentFragment(file:///data/data/com.microoled.activelook.mobile/files/app/vendor.js:27493:17)
System.err: at Frame.onUnloaded(file:///data/data/com.microoled.activelook.mobile/files/app/vendor.js:27475:10)
System.err: at (file:///data/data/com.microoled.activelook.mobile/files/app/vendor.js:20445:20)
System.err: at ViewBase.callFunctionWithSuper(file:///data/data/com.microoled.activelook.mobile/files/app/vendor.js:20426:5)
System.err: at ViewBase.callUnloaded(file:///data/data/com.microoled.activelook.mobile/files/app/vendor.js:20444:10)
System.err: at DialogFragmentImpl.onDismiss(file:///data/data/com.microoled.activelook.mobile/files/app/vendor.js:22626:15)
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
I think the issue comes indeed from the fact that the manager used to opened the modal window
|
this._dialogFragment.show(parent._getRootFragmentManager(), this._domId.toString()); |
is not the same as the one used in
disposeCurrentFragment
|
const manager: androidx.fragment.app.FragmentManager = this._getFragmentManager(); |
which gets the FragmentManager here
|
manager = dialogFragment.getChildFragmentManager(); |
Using rc version and @nativescript/core i am facing an issue with modal views.
To counter that isssue #7744 i need to wrap my modal views inside a
FrameSomething like this
But now it crashes on Android when closing the modal with this error:
I think the issue comes indeed from the fact that the manager used to opened the modal window
NativeScript/nativescript-core/ui/core/view/view.android.ts
Line 657 in cc97a16
is not the same as the one used in
disposeCurrentFragmentNativeScript/nativescript-core/ui/frame/frame.android.ts
Line 260 in cc97a16
which gets the FragmentManager here
NativeScript/nativescript-core/ui/core/view/view.android.ts
Line 339 in cc97a16