How to place common header on each activity
<p>I want to place a common header in each activity of application. For this I made header.xml  </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"&gt;

&lt;!-- 1px border top --&gt;
&lt;ImageView
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#000000" /&gt;

&lt;!-- header with text and buttons --&gt;
&lt;RelativeLayout
android:layout_height="43dp"
android:layout_width="fill_parent"
android:background="#000000"&gt;

&lt;!-- left side --&gt;
&lt;LinearLayout
  android:id="@+id/header_home_button_layout"
  android:layout_width="wrap_content"
  android:layout_height="fill_parent"
  android:orientation="horizontal"
  android:layout_alignParentLeft="true"&gt;

  &lt;!-- home button --&gt;
  &lt;ImageButton
    android:id="@+id/header_home_button"
    android:src="@drawable/menu_info"
     /&gt;

&lt;/LinearLayout&gt;

&lt;!-- header text --&gt;
&lt;TextView
  android:id="@+id/header_title"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerInParent="true"
  android:text="@string/app_name"
  android:textSize="20dp"
  android:textStyle="bold"/&gt;

&lt;!-- right side --&gt;
&lt;LinearLayout
  android:layout_width="wrap_content"
  android:layout_height="fill_parent"
  android:orientation="horizontal"
  android:layout_alignParentRight="true"&gt;

  &lt;!-- back button 
  &lt;ImageButton
    android:id="@+id/header_back_button"
    android:src="@drawable/header_btn_back"
    android:onClick="onBackClick"
    android:visibility="gone" /&gt;  
--&gt;
&lt;/LinearLayout&gt;

&lt;/RelativeLayout&gt;       
&lt;!-- 1px border bottom --&gt;
&lt;ImageView
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#000000" /&gt;

&lt;/LinearLayout&gt;  
</code></pre>

<p>And my first layout is as follows (frontpage.xml)  </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;!-- Layout for SplashScreen --&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"&gt;
&lt;include
android:id="@+id/header"
     layout="@layout/header"
     android:layout_height="wrap_content"
     android:layout_width="fill_parent" /&gt;
&lt;TextView
  android:id="@+id/headert"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerInParent="true"
  android:text="Home"
  android:textSize="20dp"
  android:textStyle="bold"/&gt;
&lt;/LinearLayout&gt;  
</code></pre>

<p><strong>FrontPageActivity.java</strong>  </p>

<pre><code>package com.godfisk;

import android.app.Activity;
import android.os.Bundle;

public class FrontPageActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frontpage);
}
}  
</code></pre>

<p>But the application crashes on reaching onCreate after <strong>super.onCreate(savedInstanceState);</strong>  </p>

<p>What am I possibely missing?  </p>

<p>Thankx</p>
