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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:20:16+00:00 2026-05-22T19:20:16+00:00

I am having weird stack trace from my application in the android market. I

  • 0

I am having weird stack trace from my application in the android market.
I have a view switcher which contains two views, one of them contains a checkbox.

I am getting this stack trace AdDetailView beeing a custom view.

  android.view.InflateException: Binary XML file line #29: Error inflating class android.widget.CheckBox
  at android.view.LayoutInflater.createView(LayoutInflater.java:513)
  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:382)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  at com.yakaz.view.AdDetailView.init(AdDetailView.java:67)
  at com.yakaz.view.AdDetailView.<init>(AdDetailView.java:78)

This happens in the following view contructor :

private void init(Context context) {
    LayoutInflater li = (LayoutInflater) context
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    li.inflate(R.layout.ad_detail_view, this);
    setOrientation(LinearLayout.VERTICAL);
}

public AdDetailView(Context context, AttributeSet attrs) {
    super(context, attrs);
    init(context);
}

The line 67 is the inflate line.

The problem is that i can’t reproduce the problem, on emulator or device.
Any pointers ?

Here is the ad_detail_view.xml

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:id="@+id/preview_warning"
    style="@style/Notification" android:text="@string/this_is_only_a_preview"
    android:visibility="gone" />

<ScrollView android:layout_width="fill_parent"
    android:fadingEdge="none" android:layout_height="fill_parent"
    android:layout_weight="1" android:fillViewport="true" android:id="@+id/scrolls">
    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:orientation="vertical">

        <include layout="@layout/action_bar" />

        <LinearLayout android:orientation="horizontal"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:paddingTop="10dp" android:paddingLeft="10dp"
            android:paddingRight="10dp">
            <!--  tags -->
            <LinearLayout android:id="@+id/tagsLayout"
                android:orientation="horizontal" android:layout_width="fill_parent"
                android:layout_weight="1" android:layout_height="wrap_content" />
            <CheckBox android:id="@+id/save_button" style="@style/StarButton"
                android:layout_marginRight="10sp" />
        </LinearLayout>


        <!--  meta -->
        <Button android:id="@+id/meta" style="@style/Meta"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"/>


        <!-- pictures -->
        <LinearLayout android:orientation="horizontal"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:gravity="center" android:id="@+id/gallery_container">
            <Gallery android:id="@+id/gallery" android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
        </LinearLayout>


        <!--  padded layout -->
        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:orientation="vertical"
            android:padding="5dp">

            <!-- summary -->
            <TextView android:id="@+id/summary" style="@style/AdDetailSummary"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:paddingBottom="10dp" />


        </LinearLayout>


        <!--  tab -->
        <LinearLayout android:layout_width="fill_parent"
            android:orientation="vertical" android:layout_height="wrap_content"
            android:background="@drawable/bottom_green_bar" android:paddingLeft="10dp">
            <TextView android:layout_width="wrap_content" android:id="@+id/tab_title"
                android:gravity="center" android:layout_height="wrap_content"
                android:text="@string/member_profile" style="@style/TabLabel" />
        </LinearLayout>

        <!-- user detail -->
        <LinearLayout android:layout_width="fill_parent"
            android:orientation="vertical" android:layout_height="wrap_content"
            android:background="@color/very_light_gray" android:paddingBottom="10dp">
            <!--  user item -->

            <include layout="@layout/user_item" />
            <include layout="@layout/website_item" />

        </LinearLayout>
    </LinearLayout>
</ScrollView>
</merge>

style.xml :

<style name="StarButton">
    <item name="android:background">@drawable/bk_star_button</item>
    <item name="android:layout_width">30dp</item>
    <item name="android:layout_height">30dp</item>
    <item name="android:button">@android:id/empty</item>
</style>

bk_star_button.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/btn_star_big_off"
      android:state_checked="false"/>
    <item android:drawable="@drawable/btn_star_big_on"
      android:state_checked="true"/>          
</selector>

here is another layout that as the exact same exception raised on some device :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:background="@drawable/bk_gradient">
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:gravity="left|center_vertical" style="@style/TopBar"
        android:id="@+id/titlebar">
        <ImageView android:src="@drawable/logo" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:background="@null"
        android:layout_alignParentLeft="true" />

        <FrameLayout android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_centerVertical="true"
        android:paddingLeft="8dp" android:id="@+id/search_progressbar"
        android:visibility="gone">
            <ProgressBar android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            style="@style/ProgressBarMedium" />
        </FrameLayout>

    <LinearLayout android:id="@+id/buttons_container"
    android:gravity="right|center_vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
</LinearLayout>
    ....
</LinearLayout>
</LinearLayout>

the code that raises the exception :

public static CompoundButton addTitleBarCompoundButton(Context context,
        View titleBar, CharSequence label, boolean isChecked) {
    if (!(titleBar instanceof ViewGroup))
        return null;

    ViewGroup group = (ViewGroup) titleBar
            .findViewById(R.id.buttons_container);

    // We attach to root during the inflating process othersize layout_
    // parameters in the style are ignored
    LayoutInflater.from(context).inflate(R.layout.topbar_toggle_button,
            group, true);

    // Get the result, which is the last child of the group
    CompoundButton result = (CompoundButton) group.getChildAt(group
            .getChildCount() - 1);
    result.setChecked(isChecked);

    // Set the text
    result.setText(label);
    return result;
}

topbar_toggle_button.xml :

<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android" style="@style/BarButton.Toggle"/>
  • 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-22T19:20:17+00:00Added an answer on May 22, 2026 at 7:20 pm

    I suspect it has something to do with you setting the android:button parameter to @android:id/empty. Can you elaborate on why you are doing this? It seems to me that you have created custom checked/unchecked views via a <selector> on the background, so the button element should be cleared out. If my assumption is correct, you should do that in this fashion:

    <style name="StarButton">
      <item name="android:background">@drawable/bk_star_button</item>
      <item name="android:layout_width">30dp</item>
      <item name="android:layout_height">30dp</item>
      <item name="android:button">@null</item>
    </style>
    

    The @null attribute is provided as a way to clear default attributes, whereas @android:id/empty is the id used by the system to reference the “empty” view that is presented by AdapterView instances when they have no items to display. This discrepancy could cause a host of unknown behaviors.

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

Sidebar

Related Questions

I'm having weird issue during application relaunch, I get two Navigation Bars when I
This is a really weird problem that I have been having. When I download
This is a weird problem I have started having recently. My team is developing
Having a weird issue. I'm new to Macs and have a windows VM that
I'm having a weird issue concerning Microsoft SQL Compact Edition. In a Windows.Forms application,
I'm having a weird problem using [UIImage imageNamed:] method to set table view cells'
I'm having a weird issue with Visual Studio 2008. Every time I fire it
I'm having some weird issues with Xcode, and this is pretty much impossible to
I'm having an extremely weird problem with a PHP script of mine. I'm uploading
I'm new to Ruby, so I'm having some trouble understanding this weird exception problem

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.