嵌套的PreferenceScreens会丢失自定义PreferenceActivity布局

我有一个首选项活动,它从以下XML获取它的布局。这使按钮显示在首选项的底部。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:myapp="http://schemas.android.com/apk/res/com.stealthcopter.nexus.nexusgl"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
<ListView android:id="@android:id/list"
    android:layout_weight="1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
<Button android:text="This is a button on top of all preferences."
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />         
</LinearLayout>
但是当打开一个嵌套的PreferenceScreen里面它还原到只显示一个列表视图时,是否有一种简单的方法可以在首选项屏幕之间保持相同的布局? 我试过PreferenceScreen.setLayoutResource(R.id.layout.main);但这只会更改打开前显示的视图 更新 我通过将嵌套的PreferenceScreens更改为普通首选项并覆盖其onclick方法以清除listview中的首选项并从适当的XML文件重新加载首选项来修复(Kludged)。     
已邀请:
我相信这是此处描述的错误的另一个症状 解决方法是每次打开首选项屏幕时重置布局。     
您想通过自定义首选项屏幕实现什么目标?这里没有优先考虑?我也非常确定首选项布局必须在'xml'文件夹中而不是'layout'     

要回复问题请先登录注册