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

  • Home
  • SEARCH
  • 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 959709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:04:10+00:00 2026-05-16T01:04:10+00:00

I am using Eclipse and created HelloWorld and it works fine using emulator. Then

  • 0

I am using Eclipse and created HelloWorld and it works fine using emulator.
Then I tried to create ToDoList app where you can enter text and click to submit, following the example on the book I have and getting an error that cause my app to force close when I interact with the application.

my directory structure: (please ignore other folders)

ProjectToDoList
   |
   |-----src
   |      |----com.test.dotolist
   |                          |------ToDoList.java
   |                          |------ToDoListItemView.java
   ------res
          |
          |----layout
                 |-------main.xml
                 |-------todolist_item.xml

I tracked where it is happening:

If I just use default layout in ToDoList.java like:

 final ArrayList<String> todoItems = new ArrayList<String>();
 final ArrayAdapter<String> aa;
 aa = new ArrayAdapter<String>(this, 
            android.R.layout.simple_expandable_list_item_1, todoItems);

The app works fine. I can type in text and click a button for the text to show up.

But I’m trying to use my custom layout:

ToDoList.java,

        final ArrayList<String> todoItems = new ArrayList<String>();
        int resID = R.layout.todolist_item;

        //create array adopter to bind the array to the listview
        final ArrayAdapter<String> aa;
        aa = new ArrayAdapter<String>(this, resID, todoItems);

        //bind the array adapter to the listview
        myListView.setAdapter(aa);

As you can see when I try to pass resID to ArrayAdapter, it compile and my app shows up on the emulator. But when I click submit button, it force to close.

todoList_item.xml

<?xml version="1.0" encoding="utf-8"?>
<com.test.todolist.ToDoListItemView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:scrollbars="vertical"
    android:textColor="@color/notepad_text"
    android:fadingEdge="vertical"    
/>

The logcat output: (I can’t figure out what’s wrong)

W/KeyCharacterMap(  279): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
D/AndroidRuntime(  279): Shutting down VM
W/dalvikvm(  279): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(  279): FATAL EXCEPTION: main
E/AndroidRuntime(  279): android.view.InflateException: Binary XML file line #2: Error inflating class com.test.todolist.ToDoListItemView
E/AndroidRuntime(  279):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
E/AndroidRuntime(  279):    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
E/AndroidRuntime(  279):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
E/AndroidRuntime(  279):    at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
E/AndroidRuntime(  279):    at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
E/AndroidRuntime(  279):    at android.widget.AbsListView.obtainView(AbsListView.java:1315)
E/AndroidRuntime(  279):    at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)
E/AndroidRuntime(  279):    at android.widget.ListView.onMeasure(ListView.java:1109)
E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)
E/AndroidRuntime(  279):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
E/AndroidRuntime(  279):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
E/AndroidRuntime(  279):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
E/AndroidRuntime(  279):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)
E/AndroidRuntime(  279):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
E/AndroidRuntime(  279):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)
E/AndroidRuntime(  279):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
E/AndroidRuntime(  279):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)
E/AndroidRuntime(  279):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
E/AndroidRuntime(  279):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
E/AndroidRuntime(  279):    at android.view.View.measure(View.java:8171)
E/AndroidRuntime(  279):    at android.view.ViewRoot.performTraversals(ViewRoot.java:801)
E/AndroidRuntime(  279):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
E/AndroidRuntime(  279):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  279):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  279):    at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  279):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  279):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  279):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  279):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  279):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  279): Caused by: java.lang.ClassNotFoundException: com.test.todolist.ToDoListItemView in loader dalvik.system.PathClassLoader[/data/app/com.test.dotolist-1.apk]
E/AndroidRuntime(  279):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime(  279):    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime(  279):    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime(  279):    at android.view.LayoutInflater.createView(LayoutInflater.java:466)
E/AndroidRuntime(  279):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
E/AndroidRuntime(  279):    ... 32 more
W/ActivityManager(   66):   Force finishing activity com.test.dotolist/.ToDoList

Please let me know if you need clarification.

  • 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-16T01:04:10+00:00Added an answer on May 16, 2026 at 1:04 am

    This is your Exception::

    Caused by: java.lang.ClassNotFoundException: com.test.todolist.ToDoListItemView in loader dalvik.system.PathClassLoader[/data/app/com.test.dotolist-1.apk]
    

    and see your Package::

    ProjectToDoList
       |
       |-----src
       |      |----com.test.dotolist
       |                          |------ToDoListItemView.java
    

    todolist != dotolist

    you have in your todoList_item.xml

    <com.test.todolist.ToDoListItemView
    

    Change to::

    <com.test.dotolist.ToDoListItemView
    

    this must work! =)

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

Sidebar

Related Questions

I just created an app for Android using Eclipse, and everything works, however, when
I am trying to create an android project using eclipse IDE,its created successfully but
I have created a maven project in eclipse using the maven2eclipse plugin. I then
I'm using Eclipse Scala plugin. I created a simple program: object HelloWorld { override
Using Eclipse IDE. The line: getClass().getResource(/res/bitmaps/image.png); returns null . I have created the res
I have recently just created Java project using Eclipse that requires 2 JAR files
I have recently created a web project in Java using eclipse. I have a
i'm using eclipse platform and window builder pro within. I've already created new project
I'm using git through Eclipse. I created a new file, as well as making
I successfully created a project using Wicket quickstart and turned it into an Eclipse

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.