FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Remove frame on frame.unload · NativeScript/NativeScript@8241e4b · GitHub

Commit 8241e4b

Browse files
authored andcommitted
fix: Remove frame on frame.unload
1 parent 30981aa commit 8241e4b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎tns-core-modules/ui/frame/frame.android.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,23 @@ export class Frame extends FrameBase {
176176
}
177177
}
178178

179+
onUnloaded(){
180+
if(this._currentEntry && this._currentEntry.fragment){
181+
console.log("?!?@# ===> removing fragment: " + this._currentEntry.fragmentTag);
182+
183+
const manager: android.app.FragmentManager = this._getFragmentManager();
184+
185+
const transaction = manager.beginTransaction();
186+
transaction.remove(this._currentEntry.fragment);
187+
transaction.commitAllowingStateLoss();
188+
}
189+
190+
super.onUnloaded();
191+
}
192+
179193
private createFragment(backstackEntry: BackstackEntry, fragmentTag: string): android.app.Fragment {
194+
console.log("?!?@# ===> creating fragment: " + fragmentTag);
195+
180196
ensureFragmentClass();
181197
const newFragment = new fragmentClass();
182198
const args = new android.os.Bundle();

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL