构建布局文件时,资源ID R.ID.map会自动添加到Android项目中
您好,我正在开发一个地图应用程序,在这个应用程序中,当您构建布局文件时,资源ID R.ID.map应该自动添加到Android项目中。但它会给出错误,而不是自动解决它。如何解决。谢谢构建布局文件时,资源ID R.ID.map会自动添加到Android项目中,android,android-maps-v2,Android,Android Maps V2,您好,我正在开发一个地图应用程序,在这个应用程序中,当您构建布局文件时,资源ID R.ID.map应该自动添加到Android项目中。但它会给出错误,而不是自动解决它。如何解决。谢谢 mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); 您不是动态插入FramAgent,而是使用findFragmentById查找映射片段。这意味着您需要在布局文件中包含地图片段 布局文件中可能缺少以下内
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
您不是动态插入FramAgent,而是使用findFragmentById查找映射片段。这意味着您需要在布局文件中包含地图片段 布局文件中可能缺少以下内容
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
您没有动态插入FramAgent,而是使用findFragmentById查找映射片段。这意味着您需要在布局文件中包含地图片段 布局文件中可能缺少以下内容
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />