@@ -161,7 +161,7 @@ function initializeNativeClasses() {
161
161
}
162
162
163
163
instantiateItem ( container : android . view . ViewGroup , position : number ) : java . lang . Object {
164
- const fragmentManager = this . owner . _getFragmentManager ( ) ;
164
+ const fragmentManager = this . owner . _getRootFragmentManager ( ) ;
165
165
if ( ! this . mCurTransaction ) {
166
166
this . mCurTransaction = fragmentManager . beginTransaction ( ) ;
167
167
}
@@ -198,16 +198,16 @@ function initializeNativeClasses() {
198
198
199
199
destroyItem ( container : android . view . ViewGroup , position : number , object : java . lang . Object ) : void {
200
200
if ( ! this . mCurTransaction ) {
201
- const fragmentManager = this . owner . _getFragmentManager ( ) ;
201
+ const fragmentManager = this . owner . _getRootFragmentManager ( ) ;
202
202
this . mCurTransaction = fragmentManager . beginTransaction ( ) ;
203
203
}
204
204
205
205
const fragment : androidx . fragment . app . Fragment = object as androidx . fragment . app . Fragment ;
206
206
207
207
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
+ // }
211
211
this . mCurTransaction . detach ( fragment ) ;
212
212
213
213
if ( this . mCurrentPrimaryItem === fragment ) {
@@ -586,6 +586,7 @@ export class Tabs extends TabsBase {
586
586
}
587
587
588
588
public disposeNativeView ( ) {
589
+ console . log ( 'disposeNativeView' ) ;
589
590
this . _tabsBar . setItems ( null , null ) ;
590
591
( this . _pagerAdapter as any ) . owner = null ;
591
592
this . _pagerAdapter = null ;
@@ -610,10 +611,11 @@ export class Tabs extends TabsBase {
610
611
}
611
612
612
613
private disposeCurrentFragments ( ) : void {
613
- const fragmentManager = this . _getFragmentManager ( ) ;
614
+ const fragmentManager = this . _getRootFragmentManager ( ) ;
614
615
const transaction = fragmentManager . beginTransaction ( ) ;
615
616
616
617
const fragments = this . fragments ;
618
+ console . log ( 'disposeCurrentFragments' , fragments . length ) ;
617
619
for ( let i = 0 ; i < fragments . length ; i ++ ) {
618
620
transaction . remove ( fragments [ i ] ) ;
619
621
}
0 commit comments