我需要使用包含com.google.android.gms.maps.SupportMapFragment
FragmentPagerAdapter:
@Override
public Fragment getItem(int position) {
return TargetFragment.getInstance(tasks.getTaskList().get(position));
}
TargetFragment布局:
...
<fragment
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_margin="5dp" />
</LinearLayout>
</LinearLayout>
但如果我有多个TargetFragment,我会收到错误
IllegalArgumentException: Binary XML file line #119: Duplicate id 0x7f080073, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment