您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Viewpager中的Google Map实施,错误无法获取提供商

Viewpager中的Google Map实施,错误无法获取提供商

我有解决方案,而不是使用onViewCreated()方法代替onActivityCreated()方法,而是使用了构建版本目标API 23,谢谢。

@Override
    public void onViewCreated(View view, Bundle savedInstanceState) {

        insertNestedFragment();

    }

    // Embeds the child fragment dynamically
    private void insertNestedFragment() {
        FragmentManager fm = getChildFragmentManager();
        mSupportMapFragment = (SupportMapFragment) fm.findFragmentById(R.id.child_fragment_container);
        if (mSupportMapFragment == null) {
            mSupportMapFragment = SupportMapFragment.newInstance();
            fm.beginTransaction().replace(R.id.child_fragment_container, mSupportMapFragment).commit();
        }
    }
Go 2022/1/1 18:16:18 有460人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶