1

I'm creating an android application and I have an Activity including a ScrollView and a MapView in it.

When I scroll the ScrollView a black render appear around google map . like this video https://www.youtube.com/watch?v=tBkU7FuNawE&feature=youtu.be

Here is my code

activity_test_map_view.xml

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            //some content

        </LinearLayout>

        <com.google.android.gms.maps.MapView
            android:id="@+id/map_view"
            android:layout_width="match_parent"
            android:layout_height="250dp" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">
             //some content           

        </LinearLayout>

    </LinearLayout>

</ScrollView>

TestMapViewActivity

    public class TestMapViewActivity extends AppCompatActivity implements OnMapReadyCallback{

        MapView mapView;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_test_map_view);

    //        // Gets the MapView from the XML layout and creates it
            mapView.onCreate(savedInstanceState);
            // Gets to GoogleMap from the MapView and does initialization stuff
            mapView.getMapAsync(this);


        }

        @Override
        public void onMapReady(GoogleMap googleMap) {
        }
}

How can I solve this problem?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
omid naghipoor
  • 178
  • 1
  • 2
  • 12
  • Possible duplicate of [How to put Google Maps V2 on a Fragment Using ViewPager](https://stackoverflow.com/questions/19353255/how-to-put-google-maps-v2-on-a-fragment-using-viewpager) – Mahavir Jain Jul 10 '18 at 08:51
  • That doesn't work for my problem . Still black render appears. – omid naghipoor Jul 10 '18 at 09:02

1 Answers1

0

Finally I find the solution by just add this line in Manifest.xml

android:hardwareAccelerated="true"
omid naghipoor
  • 178
  • 1
  • 2
  • 12