Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8906779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:44:30+00:00 2026-06-15T02:44:30+00:00

I have a layout with a Button on it: <Button android:id=@+id/myapp_new style=@style/header_button android:layout_width=wrap_content android:layout_height=wrap_content

  • 0

I have a layout with a Button on it:

<Button
    android:id="@+id/myapp_new"
    style="@style/header_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_centerVertical="true"
    android:background="@drawable/header_button"
    android:gravity="center"
    android:text="new" />

The style for the button is defined as such:

<style name="header_button" parent="@android:style/TextAppearance.Medium">
    <item name="android:textColor">@color/white</item>
    <item name="android:textSize">16sp</item>
</style>

When I open this Activity on my phone, I receive a crash. The crash happens during the line that sets the content view:

setContentView(R.layout.layout_tags);

If I remove the android:background parameter, the crash goes away. I don’t understand because the drawable is included in the app and it works fine on other devices, including the emulator.

I will post the error log at the bottom of this thread.

As I said, this crash is only happening on 1 of my devices (I have 2 + emulator). It is occurring on an older phone running Android 2.2.1, but is not occurring on my emulator (running 2.2) or my newer phone (running 4.1.2).

The biggest difference is my device with the crash has a low screen resolution. I have no images in the ldpi folder. I was under the impression that Android would automatically choose the image from the next folder up. Also, I have lots of other images that load just fine.

I’d really like to release my app into the Google Play store, but this is holding me up. I worry that this crash will happen on other people’s phones even though I can only reproduce it on one device. Does anyone have any ideas? I’m lost.

11-26 12:03:04.740: E/AndroidRuntime(2800): FATAL EXCEPTION: main
11-26 12:03:04.740: E/AndroidRuntime(2800): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app/com.myapp.app.activity.ActivityTags}: android.view.InflateException: Binary XML file line #65: Error inflating class android.widget.Button
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.os.Looper.loop(Looper.java:123)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.main(ActivityThread.java:4627)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Method.invokeNative(Native Method)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Method.invoke(Method.java:521)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at dalvik.system.NativeStart.main(Native Method)
11-26 12:03:04.740: E/AndroidRuntime(2800): Caused by: android.view.InflateException: Binary XML file line #65: Error inflating class android.widget.Button
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.Activity.setContentView(Activity.java:1647)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.myapp.app.activity.ActivityTags.onCreate(ActivityTags.java:75)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-26 12:03:04.740: E/AndroidRuntime(2800):     ... 11 more
11-26 12:03:04.740: E/AndroidRuntime(2800): Caused by: java.lang.reflect.InvocationTargetException
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.widget.Button.<init>(Button.java:65)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Constructor.constructNative(Native Method)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)
11-26 12:03:04.740: E/AndroidRuntime(2800):     ... 26 more
11-26 12:03:04.740: E/AndroidRuntime(2800): Caused by: java.lang.StackOverflowError
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable$StateListState.<init>(StateListDrawable.java:255)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.<init>(StateListDrawable.java:301)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.<init>(StateListDrawable.java:68)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:750)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.getDrawable(Resources.java:581)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.getDrawable(Resources.java:581)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.getDrawable(Resources.java:581)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createF
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:44:31+00:00Added an answer on June 15, 2026 at 2:44 am

    The StackOverflowError exception makes me think that your header_button background depends on itself, so it’s recursively loading the same file until it dies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button like this: <Button android:id=@+id/logout_button android:layout_width=fill_parent android:layout_height=wrap_content android:text=Log out /> and
I have a button that basically looks like this: <Button android:id=@+id/admin_new_questions android:layout_width=fill_parent android:layout_height=wrap_content android:text=See
I have in my layout a button, which is has to change image when
I have a Linear Layout that has a Button and a TextView on it.
I have to add a custom layout in a relative layout on a button
I have a linear layout with several buttons in it. The button images are
I have a listView, where each row has a button in the row layout.
Typical search layout having RelativeLayout, TextView, EditText and Button I have a.9.png image having
How to align the buttons bottom of the screen.In the layout i have header
I have many buttons in my layout and they work well. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.