我正在開發它採用片段標籤的應用程序,我的片段的人使用谷歌地圖V2 「SupportMapFragment
」Android的碎片谷歌地圖V2:錯誤充氣類
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->返回時,片段onCreateView
拋出異常,「android.view.InflateException:二進制XML文件行#132:錯誤充氣類片段「
檢查我的答案上所以在這個環節:http://stackoverflow.com/questions/19353255/how-to-put-google-maps-v2-on-a-fragment-using- viewpager/19354359#19354359 – Arshu