项目场景:
android 高德地图 出现 Attempt to read from field 'android.view.Surface android.view.ViewRootImpl.m。。。
问题描述:
将高德地图嵌入到fragment,然后切换页面时一直出现Attempt to read from field 'android.view.Surface android.view.ViewRootImpl.m。。。报错却正常运行。。。。
原因分析:
我经过多次debug,发现时 高德的问题。。。。开玩笑哈哈哈
解决方案:
在对应的xml文件中
<com.amap.api.maps.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" />
将MapView 改成TextureMapView即可,即改成如下
<com.amap.api.maps.TextureMapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" />