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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:42:10+00:00 2026-06-17T19:42:10+00:00

I have CustomLayout class declared in a library customAndroidLibrary. This CustomLayout extends ViewGroup .

  • 0

I have CustomLayout class declared in a library customAndroidLibrary. This CustomLayout extends ViewGroup. Now I want to use this CustomLayout in my layout.xml which is in my project. I have included this library in my project.

CustomLayout class

package com.android.custom;
public class CustomLayout extends ViewGroup {
    .....
}

layout.xml

<com.android.custom.CustomLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/animation_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</com.android.custom.CustomLayout>

MainActivity

package com.android.ui;    
public class MainActivity extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout);
    }
}

But it is throwing ClassNotFoundException.
Even it is not detecting my Activity also if I am using the custom view in layout.xml
If I am using simple TextView in layout.xml. Then it is not giving any error.

  • 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-17T19:42:10+00:00Added an answer on June 17, 2026 at 7:42 pm

    Solved it on my own.

    <com.android.custom.CustomLayout   
        xmlns:android="http://schemas.android.com/apk/res/android"
        class="com.android.custom.CustomLayout"
        android:id="@+id/animation_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </com.android.custom.CustomLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use NineOldAndroids library to scale my custom layout. public class MyLayout extends FrameLayout
I have created a custom layout which extends ViewGroup. Everything is working fine and
have written this little class, which generates a UUID every time an object of
recently I created a java class Custom Layout Manager , which I want to
I have a custom layout defined in XML file which has a RelativeLayout root
I have a custom dialog which extends the Dialog class and a simple custom
I have a custom alertdialog that inflates this custom layout: <?xml version=1.0 encoding=utf-8?> <RelativeLayout
I want to implement the below: A spinner which would have a custom layout,
I have a actionbar with a custom layout, but this show me the icon
If i have a expandablelistview with custom layout (group.xml and child.xml), the are any

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.