私は現代SettingsActivity
を使用していPreferenceFragement
ます。そのレイアウトを完全に XML で定義しました。私の設定では、設定サブスクリーンがあります。それをクリックすると、新しいPreferenceScreen
ものが表示されます。
戻るボタンを使用してメイン設定画面に戻ることしかできないようです。サブ画面でナビゲーションを有効にする方法はありActionBar
ますか? XML経由で有効にすることをお勧めします。
前もってありがとう、カオリック
編集:
左側と同じように右側にも同じものが必要です。
これは、Google からのコード スニペットです。
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- opens a subscreen of settings -->
<PreferenceScreen
android:key="button_voicemail_category_key"
android:title="@string/voicemail"
android:persistent="false">
<ListPreference
android:key="button_voicemail_provider_key"
android:title="@string/voicemail_provider" ... />
<!-- opens another nested subscreen -->
<PreferenceScreen
android:key="button_voicemail_setting_key"
android:title="@string/voicemail_settings"
android:persistent="false">
...
</PreferenceScreen>
<RingtonePreference
android:key="button_voicemail_ringtone_key"
android:title="@string/voicemail_ringtone_title"
android:ringtoneType="notification" ... />
...
</PreferenceScreen>
...
</PreferenceScreen>