title: How to include Preference in Layout
body: <p>Can I include a preference in Layout like how we include a layout in another layout using <code>&lt;include layout=""/&gt;</code> tag.</p>
  
  <p>My layout code goes like this </p>
  
  <pre><code>&lt;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"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
  
      android:padding="@dimen/padding_medium"
      android:text="@string/hello_world"
      tools:context=".MainActivity" /&gt;
  
  &lt;include layout="@layout/settings"/&gt;
  &lt;!-- &lt;include layout="@xml/set_variables"/&gt; --&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>in the above layout i am trying to include preference <code>@xml/set_variables</code> but my application will crash if i uncomment <code>&lt;include layout="@xml/set_variables"/&gt;</code> . Please can any one suggest is there any way to include preference in layout or just I should forget this .</p>