I want to launch a new fragment to view some data. Currently, I have a main activity that has a bunch of actionbar tabs, each of which is a fragment. So, within a tab fragme
Try this it may help you:
private void changeFragment(Fragment targetFragment){ getSupportFragmentManager() .beginTransaction() .replace(R.id.main_fragment, targetFragment, "fragment") .setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE) .commit(); }