File tree 1 file changed +4
-1
lines changed
src/libs/Mapbox.Maui/Platforms/Android
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 9
9
using GeoJSON . Text ;
10
10
using Com . Mapbox . Maps . Plugins . Gestures ;
11
11
using Com . Mapbox . Maps . Plugins . Gestures . Generated ;
12
+ using Microsoft . Maui ;
13
+ using AndroidX . Fragment . App ;
12
14
13
15
namespace MapboxMaui ;
14
16
public partial class MapboxViewHandler
@@ -240,7 +242,8 @@ protected override PlatformView CreatePlatformView()
240
242
} ;
241
243
mapboxFragment = new MapboxFragment ( ) ;
242
244
243
- var fragmentTransaction = mainActivity . SupportFragmentManager . BeginTransaction ( ) ;
245
+ var fragmentManager = MauiContext . Services . GetService < FragmentManager > ( ) ;
246
+ var fragmentTransaction = fragmentManager . BeginTransaction ( ) ;
244
247
fragmentTransaction . Replace ( fragmentContainerView . Id , mapboxFragment , $ "mapbox-maui-{ fragmentContainerView . Id } ") ;
245
248
fragmentTransaction . CommitAllowingStateLoss ( ) ;
246
249
return fragmentContainerView ;
You can’t perform that action at this time.
0 commit comments