【发布时间】:2013-10-15 08:57:11
【问题描述】:
我正在开发一个使用片段选项卡的应用程序,我的一个片段使用 Google Maps V2 "SupportMapFragment"
public class A extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
View view = null;
view = inflater.inflate(R.layout.all_coffee_shops_view, container, false);
map = ((SupportMapFragment) getActivity().getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
}
}
我的 xml:
<RelativeLayout
android:id="@+id/map_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
class="com.google.android.gms.maps.SupportMapFragment"
/>
</RelativeLayout>
我从这个 A 片段(A->B)调用 B 片段,当我从 B-> 回来时,A 片段 onCreateView 抛出异常,“android.view.InflateException: Binary XML file line # 132: 膨胀类片段时出错”
【问题讨论】:
-
在此链接上查看我对 SO 的回答:stackoverflow.com/questions/19353255/…