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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:41:08+00:00 2026-06-13T06:41:08+00:00

I get a strange NullPointerException . There is no pointing in my code. Also

  • 0

I get a strange NullPointerException. There is no pointing in my code. Also I know that my app gives this NullPointerException only on:

Manufacturer : Sony Ericsson
Product : MT11i_1256-3856
Android-version : 2.3.4

Any ideas?

java.lang.NullPointerException
    at android.widget.AbsListView.contentFits(AbsListView.java:722)
    at android.widget.AbsListView.onTouchEvent(AbsListView.java:2430)
    at android.widget.ListView.onTouchEvent(ListView.java:3447)
    at android.view.View.dispatchTouchEvent(View.java:3952)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:995)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1711)
    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1145)
    at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1695)
    at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2217)
    at android.view.ViewRoot.handleMessage(ViewRoot.java:1901)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3701)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
    at dalvik.system.NativeStart.main(Native Method)
  • 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-13T06:41:09+00:00Added an answer on June 13, 2026 at 6:41 am

    I have lots of similar exceptions in our apps. I did some research in Android OS source code, and made a conclusion – this is bug of Android OS Gingerbread and below, and it has been fixed in Ice Cream Sandwich.

    If you want more details, look at source code of method AbsListView.contentFits in Gingerbread source tree:

    private boolean contentFits() {
        final int childCount = getChildCount();
        if (childCount != mItemCount) {
            return false;
        }
    
        return getChildAt(0).getTop() >= 0 && getChildAt(childCount - 1).getBottom() <= mBottom;
    }
    

    It’s obvious that this method will throw NullPointerException if called for empty list, because getChildAt(0) will return NULL. This was fixed in ICS source tree

    private boolean contentFits() {
        final int childCount = getChildCount();
        if (childCount == 0) return true;
        if (childCount != mItemCount) return false;
    
        return getChildAt(0).getTop() >= mListPadding.top &&
                getChildAt(childCount - 1).getBottom() <= getHeight() - mListPadding.bottom;
    }
    

    As you can see, there is a check for (childCount == 0).

    Regarding a workaround for this issue – you can declare your own class MyListView extends ListView, override method onTouchEvent and surround call to super.onTouchEvent() with a try-catch block. Of course you will need to use your custom ListView class in all places in your app.

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

Sidebar

Related Questions

I get a strange error and couldn't find the answer.. This code works well:
Hello I'm writing a little Android app (Version 2.3.3). Now i get this strange
I test my app only on local cassini web server, and I get strange
Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc
When I write software to control Zaber devices, I sometimes get strange behaviour that
I get strange errors when trying to deploy a Flask app (v0.8). I'm using
I'm Trying to setObject in NSMutableDictionary and get strange warning hear is the code
I have noticed that with Delphi 2009, I often get strange errors when compiling,
I know that when I read the answer to this I will see that
This is my first strange result that I never expected. This is may be

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.