I have this method which can be called from normal Activity:
getBaseContext().getResources().updateConfiguration(config2, getBaseContext().getResources().getDisplayMetrics());
The problem is I cannot call getBaseContext() in Fragment, how can I to do that? Or with what do I need to replace the getBaseContext() from a Fragment class?
You can use
getActivity(), which returns the activity associated with a fragment.The activity is a context (since Activity extends Context).
But you can use it after the fragment is attached to the activity..