我可以像在另一个布局中使用<include layout=""/>
标签一样,在布局中包含偏好设置吗?
我的布局代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity" />
<include layout="@layout/settings"/>
<!-- <include layout="@xml/set_variables"/> -->
</LinearLayout>
在上面的布局中,我试图包含首选项
@xml/set_variables
,但是如果我取消注释<include layout="@xml/set_variables"/>
,我的应用程序将崩溃。请问有什么办法可以在布局中包含首选项,还是我应该放弃?