PreferenceFragments 중 하나를 기본값으로 설정하여 헤더를 건너 뛸 수 있습니다. 당신이 PreferenceActivity.java 소스를 살펴 때
,이 두 엑스트라를 찾을 수 있습니다 :
/**
* When starting this activity, the invoking Intent can contain this extra
* string to specify which fragment should be initially displayed.
*/
public static final String EXTRA_SHOW_FRAGMENT = ":android:show_fragment";
/**
* When starting this activity, the invoking Intent can contain this extra
* boolean that the header list should not be displayed. This is most often
* used in conjunction with {@link #EXTRA_SHOW_FRAGMENT} to launch
* the activity to display a specific fragment that the user has navigated
* to.
*/
public static final String EXTRA_NO_HEADERS = ":android:no_headers";
이제 간단하게 표시해야 PreferenceFragment 당신의 PrefenceActivity를 호출하는 의도로이 두 엑스트라를 추가 지정 기본적으로 다음과 같이
Intent intent = new Intent(this, Preferences.class);
intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, PreferencesFragment.class.getName());
intent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true);
가 기본 PreferenceFragment가 설정 활동이 @ jdr88에 의해 주어진 동일한 기술을 사용하여, 메뉴에서 시작할 때 지정됩니다. 자세한 정보는 [settingsAreMultiPane]에 대해서는 [here] (https://github.com/android/platform_packages_apps_contacts/blob/master/src/com/android/contacts/activities/PeopleActivity.java)와 Ctrl-F –