code: private void setupSimplePreferencesScreen() {
          if (!isSimplePreferences(this)) {
              return;
          }
  
          // In the simplified UI, fragments are not used at all and we instead
          // use the older PreferenceActivity APIs.
  
          // Add 'general' preferences.
          addPreferencesFromResource(R.xml.pref_general);
  
          // Add 'notifications' preferences, and a corresponding header.
          PreferenceCategory fakeHeader = new PreferenceCategory(this);
          fakeHeader.setTitle(R.string.pref_header_notifications);
          getPreferenceScreen().addPreference(fakeHeader);
          addPreferencesFromResource(R.xml.pref_notification);
  
          // Add 'data and sync' preferences, and a corresponding header.
          fakeHeader = new PreferenceCategory(this);
          fakeHeader.setTitle(R.string.pref_header_data_sync);
          getPreferenceScreen().addPreference(fakeHeader);
          addPreferencesFromResource(R.xml.pref_data_sync);
  
          // Bind the summaries of EditText/List/Dialog/Ringtone preferences to
          // their values. When their values change, their summaries are updated
          // to reflect the new value, per the Android Design guidelines.
          bindPreferenceSummaryToValue(findPreference("example_text"));
          bindPreferenceSummaryToValue(findPreference("example_list"));
          bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
          bindPreferenceSummaryToValue(findPreference("sync_frequency"));
      }
docs: Shows the simplified settings UI if the device configuration if the
  device configuration dictates that a simplified, single-pane UI should be
  shown.