Android maps extensions Google地图扩展找不到片段R.id.map
我在我的应用程序中使用谷歌地图扩展库,当我将android版本更新到5.0时,我在第行得到NullPointerException:Android maps extensions Google地图扩展找不到片段R.id.map,android-maps-extensions,Android Maps Extensions,我在我的应用程序中使用谷歌地图扩展库,当我将android版本更新到5.0时,我在第行得到NullPointerException: mMap = ((SupportMapFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.map)).getExtendedMap(); findFragmentById(R.id.map)为空 有人知道为什么吗 谢谢 布局: <RelativeLayout x
mMap = ((SupportMapFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.map)).getExtendedMap();
findFragmentById(R.id.map)为空
有人知道为什么吗
谢谢
布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mapParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="fill_horizontal" >
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.androidmapsextensions.SupportMapFragment" /></RelativeLayout>
这是此处报告的一个错误,请使用
build.gradle(app)
中的targetSdkVersion 20
作为解决此问题的方法-对我有效