private void replaceFragment(Fragment fragment) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.fragment2, fragment);
transaction.commit();
}
替换Fragment方法
最新推荐文章于 2021-10-12 17:41:35 发布