android Activity跳转到Fragment

            FragmentManager fm=getSupportFragmentManager();
            FragmentTransaction ft=fm.beginTransaction();
            PlayFragment playFragment=new PlayFragment();
            //传参 主antivity中的控件名 加fragment
            ft.replace(R.id.dl_main,playFragment);
            ft.commit();
posted @ 2021-11-21 13:24  九块  阅读(153)  评论(0编辑  收藏  举报