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 7034475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:11:26+00:00 2026-05-28T01:11:26+00:00

i have a dashboard layout that has several images. When i run the app

  • 0

i have a dashboard layout that has several images. When i run the app i get force close error and the error point to this line in dashboard avtivty where inflate the layout(i.e setContentView(R.layout.dashboard). I dont understand why. I used the same Dashboard layout with other images and all was fine. Now it has six images but much bigger in size. I don’t know if this is the problem and how to solve this? thanks.
Here is my dashboardlayout.

<com.utils.DashboardLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background" >

<Button
    android:id="@+id/home_btn_general_knowledge"
    style="@style/DPDashBoardButton"
    android:drawableTop="@drawable/general_knowledge_icon_bg_selector"
    android:onClick="onGeneralKnowledgeClick"
    android:text="General Knowledge" />

<Button
    android:id="@+id/home_btn_brainteasers"
    style="@style/DPDashBoardButton"
    android:drawableTop="@drawable/brain_teasers_icon_bg_selector"
    android:onClick="onBrainTeasersClick"
    android:text="Brain Teasers" />

<Button
    android:id="@+id/home_btn_movies"
    style="@style/DPDashBoardButton"
    android:drawableTop="@drawable/movies_icon_bg_selector"
    android:onClick="onMoviesClick"
    android:text="Movies" />

<Button
    android:id="@+id/home_btn_sports"
    style="@style/DPDashBoardButton"
    android:drawableTop="@drawable/sports_icon_bg_selector"
    android:onClick="onSportsClick"
    android:text="Sports" />

<Button
    android:id="@+id/home_btn_music"
    style="@style/DPDashBoardButton"
    android:drawableTop="@drawable/music_icon_bg_selector"
    android:onClick="onMusicClick"
    android:text="Music" />

<Button
    android:id="@+id/home_btn_celebrities"
    style="@style/DPDashBoardButton"
    android:drawableTop="@drawable/celebrity_icon_bg_selector"
    android:onClick="onCelebritiesClick"
    android:text="Celebrities" />

Here is the error logcat:

01-08 02:29:29.216: E/AndroidRuntime(4221): FATAL EXCEPTION: main
01-08 02:29:29.216: E/AndroidRuntime(4221): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hussein.android./com.hussein.android.DashBoardActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class android.widget.Button
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.os.Looper.loop(Looper.java:123)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.ActivityThread.main(ActivityThread.java:3683)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at java.lang.reflect.Method.invokeNative(Native Method)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at java.lang.reflect.Method.invoke(Method.java:507)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at dalvik.system.NativeStart.main(Native Method)
01-08 02:29:29.216: E/AndroidRuntime(4221): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class android.widget.Button
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.Activity.setContentView(Activity.java:1657)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at com.hussein.android.quizgame.DashBoardActivity.onCreate(DashBoardActivity.java:18)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
01-08 02:29:29.216: E/AndroidRuntime(4221):     ... 11 more
01-08 02:29:29.216: E/AndroidRuntime(4221): Caused by: java.lang.reflect.InvocationTargetException
01-08 02:29:29.216: E/AndroidRuntime(4221):     at java.lang.reflect.Constructor.constructNative(Native Method)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
01-08 02:29:29.216: E/AndroidRuntime(4221):     ... 22 more
01-08 02:29:29.216: E/AndroidRuntime(4221): Caused by: java.lang.StackOverflowError
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable$StateListState.indexOfStateSet(StateListDrawable.java:274)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable$StateListState.access$000(StateListDrawable.java:253)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable.onStateChange(StateListDrawable.java:95)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable.<init>(StateListDrawable.java:306)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable.<init>(StateListDrawable.java:70)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:749)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.content.res.Resources.getDrawable(Resources.java:581)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:162)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.content.res.Resources.getDrawable(Resources.java:581)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:162)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.content.res.Resources.getDrawable(Resources.java:581)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:162)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
01-08 02:29:29.216: E/AndroidRuntime(4221):     at android.graphics.drawable.Drawable.createFromXml(Dr
01-08 02:29:29.327: D/dalvikvm(4221): GC_CONCURRENT freed 284K, 52% free 2749K/5639K, external 6582K/8020K, paused 7ms+7ms

Here is a one of my the drawables sports_icon_bg_selector.xml

 <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/sports" android:state_focused="true" android:state_pressed="false"/>
    <item android:drawable="@drawable/sports" android:state_focused="true" android:state_pressed="true"/>
    <item android:drawable="@drawable/sports_blue" android:state_focused="false" android:state_pressed="true"/>
    <item android:drawable="@drawable/sports"/>
</selector>
  • 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-05-28T01:11:26+00:00Added an answer on May 28, 2026 at 1:11 am

    You have a circular definition of your drawables. One (or more) of your selectors references something that references the selector again. (Or perhaps it references itself.)

    (In my opinion, the resource compiler should catch this, but it apparently doesn’t.)

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

Sidebar

Related Questions

I understand that Primefaces Layout and Dashboard have state which can be saved. Could
This is an Objective-C/iphone SDK question. I have a dashboard view that is used
I have a web application that functions as a dashboard, allowing a user to
I have a Rails app that is generating duplicate requests for every request in
I have a dashboard item in my JasperServer that I want to call programatically
I have a Sencha Touch 2.0 app that is set up with a card
I have a rails app with several views and layouts. One of my layouts
I have downloaded the google io application and I noticed that for landscape layout,
I have a dashboard type of page that contains a bunch of sections, each
I have a 2 silverlight projects Dashboard (the main app) Dashboard.Controls (user controls) I

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.