0

I cant add a custom button to my android application.When I run it in console,it keeps showing the following error in Logcat, and force closes.Can anybody help solving this issue?

04-18 10:59:00.785: E/AndroidRuntime(368): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bsm.rssreader/com.bsm.rssreader.headlines}: android.view.InflateException: Binary XML file line #75: Error inflating class

here is my XML file,

    <?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
         >
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_weight="14.08"
            android:scaleType="fitXY"
            android:src="@drawable/logo" />

 <HorizontalScrollView 
       android:id="@+id/horizontalScrollView1" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"
       android:fillViewport="true"
       android:scrollbars="none" >


        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

 </HorizontalScrollView>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="246dp"
            android:layout_weight="26.53" >

          <ListView
        android:id="@+id/listView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:divider="#b5b5b5"
        android:dividerHeight="1dp"
        android:listSelector="@drawable/list_selector" />
        </FrameLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="30dp" >

            <ImageView
                android:id="@+id/imageView2"
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:scaleType="fitXY"
                android:src="@drawable/foot" />


            <Button
                android:id="@+id/about"
                android:layout_width="50dp"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:background="@drawable/aboutbutton" />




            <Button
                android:id="@+id/button1"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="50dp"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_toLeftOf="@+id/about"
                android:background="@drawable/ratebtn" />

        </RelativeLayout>

    </LinearLayout>

</TabHost>
Basim Sherif
  • 5,384
  • 7
  • 48
  • 90

1 Answers1

0

Have you check this line from your logcat?

Line 34: 04-18 10:59:00.785: E/AndroidRuntime(368): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Maybe you have a problem of memory leaks because of the image of button1.

This post or this post can help

Community
  • 1
  • 1
gutiory
  • 1,135
  • 5
  • 13
  • 33