@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { //Make modifications to the UI for landscape orientation } else { //Make modifications to the UI for portrait orientation } }
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (newConfig.fontScale > getResources().getConfiguration().fontScale) { //Increase text size } else { //Decrease text size } }In this example, the onConfigurationChanged method checks the new configuration's font scale and adjusts the text size accordingly. The onConfigurationChanged method is located in the android.app.Activity package library.