I changed the locale
of my application programmatically, like following:
Resources res = context.getResources();
DisplayMetrics dm = res.getDisplayMetrics();
android.content.res.Configuration conf = res.getConfiguration();
conf.locale = new Locale("cn");
res.updateConfiguration(conf, dm);
After this, I would like to refresh my currently displayed fragment's view to display with new locale settings.
So, I firstly get the current fragment (that's the latest one in backstack
):
BackStackEntry latestEntry=fragMgr.getBackStackEntryAt(fragMgr.getBackStackEntryCount()-1);
String str=latestEntry.getName();
Fragment fragment=fragMgr.findFragmentByTag(str);
After I get the currently showing fragment, I would like to refresh its view, but how to do it? Is it possible in Android to refresh the view of a fragment