SetcontentView error InflateException
<p>i wrote an xml file and every time that i write:</p>

<pre><code>    setContentView(R.layout.all_items);
</code></pre>

<p>it show me an error and exit from my app (InflateException),</p>

<p>i didnt find anything wrong with my xml file</p>

<p>thanks alot</p>

<p>this is the xml file (all_items):</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
     &gt;

    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="horizontal"
        android:gravity="center" &gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical" &gt;

            &lt;Button
                android:id="@+id/itemsAllItemsBtn"
                android:layout_width="158dp"
                android:layout_height="122dp"
                android:background="@drawable/allthings" /&gt;

            &lt;TextView
                android:id="@+id/itemsAllItemsText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="All items" &gt;

                &lt;requestFocus /&gt;
            &lt;/TextView&gt;

        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical" &gt;

            &lt;Button
                android:id="@+id/items1Btn"
                android:layout_width="wrap_content"
                android:layout_height="122dp"
                android:layout_weight="4"
                android:background="@drawable/1_image_item" /&gt;

            &lt;TextView
                android:id="@+id/items1Text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="1" /&gt;
        &lt;/LinearLayout&gt;

    &lt;/LinearLayout&gt;

    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center"
        android:orientation="horizontal" &gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical" &gt;

            &lt;Button
                android:id="@+id/items2Btn"
                android:layout_width="158dp"
                android:layout_height="131dp"
                android:layout_marginTop="20dp"
                android:background="@drawable/2" /&gt;

            &lt;TextView
                android:id="@+id/items2Text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="2" &gt;

                &lt;requestFocus /&gt;
            &lt;/TextView&gt;

        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="182dp"
            android:orientation="vertical" &gt;

            &lt;Button
                android:id="@+id/items3Btn"
                android:layout_width="wrap_content"
                android:layout_height="131dp"
                android:layout_marginTop="20dp"
                android:background="@drawable/3" /&gt;

            &lt;TextView
                android:id="@+id/items3Text"
                android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" 
                android:text="3"/&gt;

        &lt;/LinearLayout&gt;

    &lt;/LinearLayout&gt;



    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="horizontal"
        android:gravity="center" &gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical" &gt;

            &lt;Button
                android:id="@+id/items4Btn"
                android:layout_width="158dp"
                android:layout_height="130dp"
                android:background="@drawable/4" /&gt;

            &lt;TextView
                android:id="@+id/items4Text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="4" &gt;

                &lt;requestFocus /&gt;
            &lt;/TextView&gt;

        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical" &gt;

            &lt;Button
                android:id="@+id/itemsAuctionBtn"
                android:layout_width="wrap_content"
                android:layout_height="131dp"
                android:background="@drawable/auction_reduced"
                 /&gt;

            &lt;TextView
                android:id="@+id/itemsAuctionText"
                android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" 
                android:text="Auction"/&gt;

        &lt;/LinearLayout&gt;

    &lt;/LinearLayout&gt;





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

<p>where line 128 is:</p>

<pre><code>  &lt;Button
            android:id="@+id/itemsAuctionBtn"
            android:layout_width="wrap_content"
            android:layout_height="131dp"
            android:background="@drawable/auction_reduced"
             /&gt;
</code></pre>

<p>and this is the logcat:</p>

<pre><code>03-30 12:43:28.550: E/AndroidRuntime(1319): FATAL EXCEPTION: main
03-30 12:43:28.550: E/AndroidRuntime(1319): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sal/com.example.sal.AllItemsActivity}: android.view.InflateException: Binary XML file line #128: Error inflating class &lt;unknown&gt;
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.os.Looper.loop(Looper.java:137)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.ActivityThread.main(ActivityThread.java:5041)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at java.lang.reflect.Method.invokeNative(Native Method)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at java.lang.reflect.Method.invoke(Method.java:511)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at dalvik.system.NativeStart.main(Native Method)
03-30 12:43:28.550: E/AndroidRuntime(1319): Caused by: android.view.InflateException: Binary XML file line #128: Error inflating class &lt;unknown&gt;
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.Activity.setContentView(Activity.java:1881)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at com.example.sal.AllItemsActivity.onCreate(AllItemsActivity.java:23)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.Activity.performCreate(Activity.java:5104)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-30 12:43:28.550: E/AndroidRuntime(1319):     ... 11 more
03-30 12:43:28.550: E/AndroidRuntime(1319): Caused by: java.lang.reflect.InvocationTargetException
03-30 12:43:28.550: E/AndroidRuntime(1319):     at java.lang.reflect.Constructor.constructNative(Native Method)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-30 12:43:28.550: E/AndroidRuntime(1319):     ... 26 more
03-30 12:43:28.550: E/AndroidRuntime(1319): Caused by: java.lang.OutOfMemoryError
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.content.res.Resources.loadDrawable(Resources.java:1965)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.view.View.&lt;init&gt;(View.java:3330)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.widget.TextView.&lt;init&gt;(TextView.java:583)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.widget.Button.&lt;init&gt;(Button.java:107)
03-30 12:43:28.550: E/AndroidRuntime(1319):     at android.widget.Button.&lt;init&gt;(Button.java:103)
03-30 12:43:28.550: E/AndroidRuntime(1319):     ... 29 more
03-30 12:43:33.146: I/Process(1319): Sending signal. PID: 1319 SIG: 9
03-30 12:43:34.251: E/Trace(1405): error opening trace file: No such file or directory (2)
</code></pre>

<p>this is my code:</p>

<pre><code>public class AllItemsActivity extends Activity {

    private Button allItemsButton;
    private Button 1Btn,2Btn,auctionBtn,3Btn,4Btn;


    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.all_items);

        allItemsButton =(Button) findViewById(R.id.itemsAllItemsBtn);
        saleBtn =(Button) findViewById(R.id.items1Btn);
        2Btn =(Button) findViewById(R.id.items2Btn);
        3Btn =(Button) findViewById(R.id.items3Btn);
        4Btn =(Button) findViewById(R.id.items4Btn);
        auctionBtn =(Button) findViewById(R.id.itemsAuctionBtn);
        }
}
</code></pre>

<p>where line 23 is:</p>

<pre><code>    setContentView(R.layout.all_items);
</code></pre>
