For those who want all the working code. here
Custom map view class
public class CustomMapView extends MapView { private ViewParent mViewParent; public CustomMapView(Context context) { super(context); } public CustomMapView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomMapView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public CustomMapView(Context context, GoogleMapOptions options) { super(context, options); } public void setViewParent(@Nullable final ViewParent viewParent) {
Xml action layout
<ScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <location.to.your.CustomMapView android:id="@+id/mapView" android:layout_width="match_parent" android:layout_height="250dp" /> </ScrollView>
Creating an instance of a custom map class in your activity or fragment
CustomMapView mapView = (CustomMapView) findViewById(R.id.mapView);
So that he enjoys
Ismail Iqbal Jun 06 '16 at 13:47 2016-06-06 13:47
source share