Search code examples
androidlayoutpreference

include layout into preference


I have a layout for the header and the footer. And I also have a preference.xml layout. What I want to do right now is I want to include the normal layout into the preference.xml

Any idea on how to include the normal xml layout into the preference.xml layout ?


Solution

  • with include you can add a layout to other layouts:

    Example:

    <include
        android:id="@+id/include1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/normal_layout" />