MyFragment fragment = (MyFragment) getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
getSupportFragmentManager().beginTransaction().detach(fragment).attach(fragment).commit();
this will only work if u use FragmentManager
to initialize the fragment. If u have it as a <fragment ... />
in XML, it won't call the onCreateView
again. Wasted my 30 minutes to figure this out.