@@ -161,7 +161,7 @@ function initializeNativeClasses() {
161161 }
162162
163163 instantiateItem ( container : android . view . ViewGroup , position : number ) : java . lang . Object {
164- const fragmentManager = this . owner . _getFragmentManager ( ) ;
164+ const fragmentManager = this . owner . _getRootFragmentManager ( ) ;
165165 if ( ! this . mCurTransaction ) {
166166 this . mCurTransaction = fragmentManager . beginTransaction ( ) ;
167167 }
@@ -198,16 +198,16 @@ function initializeNativeClasses() {
198198
199199 destroyItem ( container : android . view . ViewGroup , position : number , object : java . lang . Object ) : void {
200200 if ( ! this . mCurTransaction ) {
201- const fragmentManager = this . owner . _getFragmentManager ( ) ;
201+ const fragmentManager = this . owner . _getRootFragmentManager ( ) ;
202202 this . mCurTransaction = fragmentManager . beginTransaction ( ) ;
203203 }
204204
205205 const fragment : androidx . fragment . app . Fragment = object as androidx . fragment . app . Fragment ;
206206
207207 const index = this . owner . fragments . indexOf ( fragment ) ;
208- if ( index !== - 1 ) {
209- this . owner . fragments . splice ( index , 1 ) ;
210- }
208+ // if (index !== -1) {
209+ // this.owner.fragments.splice(index, 1);
210+ // }
211211 this . mCurTransaction . detach ( fragment ) ;
212212
213213 if ( this . mCurrentPrimaryItem === fragment ) {
@@ -586,6 +586,7 @@ export class Tabs extends TabsBase {
586586 }
587587
588588 public disposeNativeView ( ) {
589+ console . log ( 'disposeNativeView' ) ;
589590 this . _tabsBar . setItems ( null , null ) ;
590591 ( this . _pagerAdapter as any ) . owner = null ;
591592 this . _pagerAdapter = null ;
@@ -610,10 +611,11 @@ export class Tabs extends TabsBase {
610611 }
611612
612613 private disposeCurrentFragments ( ) : void {
613- const fragmentManager = this . _getFragmentManager ( ) ;
614+ const fragmentManager = this . _getRootFragmentManager ( ) ;
614615 const transaction = fragmentManager . beginTransaction ( ) ;
615616
616617 const fragments = this . fragments ;
618+ console . log ( 'disposeCurrentFragments' , fragments . length ) ;
617619 for ( let i = 0 ; i < fragments . length ; i ++ ) {
618620 transaction . remove ( fragments [ i ] ) ;
619621 }
0 commit comments