1
1
package com .airbnb .android .react .maps ;
2
2
3
3
import android .view .View ;
4
- import android .app . Activity ;
4
+ import android .content . Context ;
5
5
6
6
import com .facebook .react .bridge .Arguments ;
7
7
import com .facebook .react .bridge .ReactContext ;
@@ -41,19 +41,19 @@ public class AirMapManager extends ViewGroupManager<AirMapView> {
41
41
42
42
private ReactContext reactContext ;
43
43
44
- private Activity reactActivity ;
44
+ private Context appContext ;
45
45
private AirMapMarkerManager markerManager ;
46
46
private AirMapPolylineManager polylineManager ;
47
47
private AirMapPolygonManager polygonManager ;
48
48
private AirMapCircleManager circleManager ;
49
49
50
50
public AirMapManager (
51
- Activity activity ,
51
+ Context context ,
52
52
AirMapMarkerManager markerManager ,
53
53
AirMapPolylineManager polylineManager ,
54
54
AirMapPolygonManager polygonManager ,
55
55
AirMapCircleManager circleManager ) {
56
- this .reactActivity = activity ;
56
+ this .appContext = context ;
57
57
this .markerManager = markerManager ;
58
58
this .polylineManager = polylineManager ;
59
59
this .polygonManager = polygonManager ;
@@ -70,12 +70,12 @@ protected AirMapView createViewInstance(ThemedReactContext context) {
70
70
reactContext = context ;
71
71
72
72
try {
73
- MapsInitializer .initialize (reactActivity );
73
+ MapsInitializer .initialize (this . appContext );
74
74
} catch (Exception e ) {
75
75
e .printStackTrace ();
76
76
emitMapError ("Map initialize error" , "map_init_error" );
77
77
}
78
- AirMapView view = new AirMapView (context , reactActivity , this );
78
+ AirMapView view = new AirMapView (context , this . appContext , this );
79
79
80
80
return view ;
81
81
}
0 commit comments