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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:29:00+00:00 2026-06-08T18:29:00+00:00

I want to make a custom RelativeLayout, but I keep getting this error: 08-01

  • 0

I want to make a custom RelativeLayout, but I keep getting this error:

08-01 02:28:19.385: E/AndroidRuntime(9989): FATAL EXCEPTION: main
08-01 02:28:19.385: E/AndroidRuntime(9989): android.view.InflateException: Binary XML     file line #1: Error inflating class com.stevenschoen.putio.CheckableRelativeLayout
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     android.view.LayoutInflater.createView(LayoutInflater.java:596)
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     android.view.LayoutInflater.inflate(LayoutInflater.java:466)
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     android.view.LayoutInflater.inflate(LayoutInflater.java:396)

...

08-01 02:28:19.385: E/AndroidRuntime(9989): Caused by: java.lang.NoSuchMethodException:     <init> [class android.content.Context, interface android.util.AttributeSet]
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     java.lang.Class.getConstructorOrMethod(Class.java:460)
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     java.lang.Class.getConstructor(Class.java:431)
08-01 02:28:19.385: E/AndroidRuntime(9989):     at     android.view.LayoutInflater.createView(LayoutInflater.java:561)

And here’s my class:

public class CheckableRelativeLayout extends RelativeLayout implements
        Checkable {

    public CheckableRelativeLayout(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }

    private boolean isChecked;
//  List<Checkable> checkableViews = new ArrayList<Checkable>();

    // @see android.widget.Checkable#isChecked()
    public boolean isChecked() {
        return isChecked;
    }

    // @see android.widget.Checkable#setChecked(boolean)
    public void setChecked(boolean isChecked) {
        this.isChecked = isChecked;
//      for (Checkable c : checkableViews) {
            // Pass the information to all the child Checkable widgets
//          c.setChecked(isChecked);
//      }
    }

    // @see android.widget.Checkable#toggle()
    public void toggle() {
        this.isChecked = !this.isChecked;
//      for (Checkable c : checkableViews) {
            // Pass the information to all the child Checkable widgets
//          c.toggle();
//      }
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        final int childCount = this.getChildCount();
        for (int i = 0; i < childCount; ++i) {
            findCheckableChildren(this.getChildAt(i));
        }
    }

    /**
     * Add to our checkable list all the children of the view that implement the
     * interface Checkable
     */
    private void findCheckableChildren(View v) {
        if (v instanceof Checkable) {
//          this.checkableViews.add((Checkable) v);
        }

        if (v instanceof ViewGroup) {
            final ViewGroup vg = (ViewGroup) v;
            final int childCount = vg.getChildCount();
            for (int i = 0; i < childCount; ++i) {
                findCheckableChildren(vg.getChildAt(i));
            }
        }
    }
}

What am I doing wrong?

  • 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-08T18:29:01+00:00Added an answer on June 8, 2026 at 6:29 pm

    You implemented only one constructor. To be able use views in xml, you should implement 2 other constructors from View:

    public CheckableRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    
    public CheckableRelativeLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom tab layout which look like this,I want to make
I want to make some custom htaccess rule for some page in magento.for this
I want to make custom search This is the output url from the form
I want to make a custom design for my magento store like this :
I want to make a custom listview with 1000+ songs. But in my application,
Good day pythonians, I want to make a custom dictionary with two main features:
I want a make a custom script.By using this script i want to change
I want to make a custom Form but I don't know which class to
I want to make custom select from the database table using Linq. We use
I want to make a custom ASP.NET control that is a subclasse of System.Web.UI.WebControls.Calendar

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.