片段不显示任何内容

时间:2015-03-25 13:50:10

标签: android android-fragments

当我第一次进入 fragment_A 时,一切正常。但是当我从其他片段跳回来时, fragment_A 不会显示任何内容。它变得完全空白。

public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {

        if (mBaseView != null) {
            ViewGroup parent = (ViewGroup) mBaseView.getParent();
            if (parent != null)
                parent.removeView(mBaseView);
        }
        try {
            mBaseView= inflater.inflate(R.layout.fragment_patrol_map, container, false);
        } catch (InflateException e) {

        }
        findView();
        init();

        return mBaseView;
    }

1 个答案:

答案 0 :(得分:0)

我认为您应该使用fragmentManager在一个活动中的片段之间进行交互。

相关问题