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

The Archive Base Latest Questions

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

I will try to be specific if I can – please be patient, first

  • 0

I will try to be specific if I can – please be patient, first time asker and relatively new to programming on this platform. Apologies if this has been asked/answered before – please link it to me. I have searched up and down but find other unrelated (to me at least) problems.

The real puzzler for me is that my app is crashing on my emulator but when installed on my phone (via upload of apk to phone and then using an AppInstaller app from market) it works.

The crash comes from a NullPointerException at the numbered line in the following code snippet (my code) of a custom list cursor adapter.

// TaskListCursorAdapter.java

@Override
public void bindView(View view, Context context, Cursor cursor) {

    super.bindView(view, context, cursor); // <<< LINE 36
    // DO OTHER BINDING OF STRINGS TO TEXT VIEWS ETC

The following error dump is created.

08-23 21:58:57.251: ERROR/AndroidRuntime(346): Uncaught handler: thread main exiting due to uncaught exception
08-23 21:58:57.411: ERROR/AndroidRuntime(346): java.lang.NullPointerException
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:149)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at adriaansapps.com.tasks.TaskListCursorAdapter.bindView(TaskListCursorAdapter.java:36)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at adriaansapps.com.tasks.TaskListCursorAdapter.newView(TaskListCursorAdapter.java:83)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.CursorAdapter.getView(CursorAdapter.java:182)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.ListView.onMeasure(ListView.java:1060)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:619)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:280)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:569)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:361)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.os.Looper.loop(Looper.java:123)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at java.lang.reflect.Method.invokeNative(Native Method)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at java.lang.reflect.Method.invoke(Method.java:521)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at dalvik.system.NativeStart.main(Native Method)

Curiously I have been happily programming and debugging away all day and out of the blue a long working and bug free portion of my app now throws up this error.

I suspect it might be a problem with the databases, but really not sure – nothing seems out of place there. Up until today I had a database with only one table – today I added a new table which also has a “_id” field as the name autoincrement key field, which I read in the docs was required for android list adapters (if memory serves). Having some experience in coding and some minor experience with databases, that seems like a bad idea to me but I am uncertain of if that is the problem and/or how else to do it.

The crash I am listing here does not display or make reference to the data in the other, new table. The cursor does not contain any query data from it. In fact if I rename the key field “_id” of the new table to something else (ie “_blah”), the crash remains.

Like I said, if I upload the apk to my phone, it works.

I have tried the following on the emulator:
– restarting adb (and eclipse) – no result
– uninstall from emulator – no result
– destory AVD profile and recreate – no result

I am developing this under the Android 2.1 SDK, and have been for the last few weeks. I have only ever had that SDK installed, I am yet to update to 2.2.

Not sure what else I can say here – hoping somebody here has experience enough to shed some light on it.

Without a fix to this, I can anticipate a very slow development process here on out (assuming I have to upload to my phone to test new code changes…).

Sorry for being long winded – hoping I am providing enough info for one of you smarter people to nail this. Thanks

  • 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-16T10:43:21+00:00Added an answer on May 16, 2026 at 10:43 am

    I think you should not call .bindView() directly form a source code. It seems you do it this way looking at your error dump:

    08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at adriaansapps.com.tasks.TaskListCursorAdapter.bindView(TaskListCursorAdapter.java:36)
    08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at adriaansapps.com.tasks.TaskListCursorAdapter.newView(TaskListCursorAdapter.java:83)
    

    Simply set an adapter of a ListView/GridView with ListView.setAdapter(…) and let the magic happen.

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

Sidebar

Related Questions

I'm fairly new to C# but I will try to make this quick! ;)
This might be a little hard to explain, but I will try. I want
I am working on an algorithm that will try to pick out, given an
I'm try to develop a regex that will be used in a C# program..
I am about to try and automate a daily build, which will involve database
Will limiting a query to one result record, improve performance in a large(ish) MySQL
Will the code below work if the clock on the server is ahead of
Will I have to pay again? I have about 9 months left before renewal
Will IE6 negotiate a 256 bit AES SSL connection if the server is capable?
Will content requested over https still be cached by web browsers or do they

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.