如何返回到previous $ P $从嵌套preferenceScreen pfenenceScreen没有preSS后退按钮 [英] how to return to the previous PrefenenceScreen from nested PreferenceScreen without press the back button

查看:190
本文介绍了如何返回到previous $ P $从嵌套preferenceScreen pfenenceScreen没有preSS后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了多层次的preferences程序与XML文件中。我想知道如何返回到previous水平没有preSS后退按钮。 如何写一些code来实现preference项目返回previous preferences水平。

I have write a multi-level Preferences in program with xml File. and i want to know how to return to the previous level without press the back button. how to write some code to implement an item in preference to return previous Preferences level.

推荐答案

我认为你正在寻找这样的事情

I think you are looking for something like this

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="NotifSettings" android:title="Notification Settings">
<PreferenceCategory android:title="Notification Settings">
    <CheckBoxPreference android:key="NotifyOption"
        android:title="Notification Status" android:defaultValue="true"
        android:summaryOn="Notifications are Enabled." android:summaryOff="Notifications are Disabled."
        android:persistent="true" />
    <Preference android:title="XXXX"
        android:dependency="NotifyOption" android:summary="xxxxxx"
        android:key="Xxx" />
</PreferenceCategory>

<PreferenceCategory android:title="YYYYY">
    <PreferenceScreen android:title="Configure Notifications"
        android:summary="yyyyy">

        <CheckBoxPreference android:key="aa"
            android:title="aaaaa" android:defaultValue="true"
            android:summary="aaaa" />

        <CheckBoxPreference android:key="bb"
            android:title="bbbbb" android:defaultValue="true"
            android:summary="bbbb." />

        ...             
        <ListPreference android:title="zzz"
            android:summary="zzzz" android:key="zz"
            android:defaultValue="0" android:entries="@array/OverDesc"
            android:entryValues="@array/OverValues" />
    </PreferenceScreen>
</PreferenceCategory>

<PreferenceCategory android:title="Alert Type">
    <CheckBoxPreference android:key="AlertVibr"
        android:title="Vibrate" android:defaultValue="true"
        android:summaryOn="Vibration Turned ON" android:summaryOff="Vibration Turned OFF" />

    <CheckBoxPreference android:key="AlertSound"
        android:title="Sound" android:defaultValue="true" android:summaryOn="Sound Turned ON"
        android:summaryOff="MUTE" />
</PreferenceCategory>

但我没有得到的是,你要返回到previous preference屏幕,若无pressing后退按钮。你可以摆脱一些更多的光线上??

But what I didnt get is that your want to return to the previous preference screen, without pressing back button. Can you shed some more light on that??

这篇关于如何返回到previous $ P $从嵌套preferenceScreen pfenenceScreen没有preSS后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆