I have a fragment that inflates an xml layout. My requirement is to update the text size on all my views inside my fragment when my Activity is resumed. I tried
This worked for me from within Fragment:
Fragment frg = null;
Class fragmentClass;
fragmentClass = MainFragment.class;
try {
frg = (android.support.v4.app.Fragment)
fragmentClass.newInstance();
} catch(Exception ex) {
ex.printStackTrace();
}
getFragmentManager()
.beginTransaction()
.replace(R.id.flContent, frg)
.commit();
I am using remove and replace both for refreshing content of Fragment like
final FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.remove(resetFragment).commit();
fragmentTransaction.replace(R.id.frame_container,resetFragment).commit();