Null Pointer Exception on simple People query

by kingkung » Wed, 07 May 2008 01:29:29 GMT

Sponsored Links
 Hey all,

Not sure what I"m doing wrong...

I have a dbHelper which makes a query for all of the rows in People.

When I do this query in my first activity, initializing dbHelper with
that activity, I get all the people as I am supposed to.

However, when I do the query in my second activity, with its own
dbHelper initialized on its own activity, the cursor is assigned
null!!  I call cursor.first(), and the app throws an NPE.

Nothing about the People database has changed... the table is the same
between the first and second activity.

Anyone know what is going on???




Null Pointer Exception on simple People query

by Ahmet A. Akin » Wed, 07 May 2008 03:03:23 GMT

 maybe you should write the stack trace.


Sponsored Links

Null Pointer Exception on simple People query

by kingkung » Wed, 07 May 2008 15:27:00 GMT

 I'm sorry, it's not that it returs a null pointer exception, it's that
when I query the People database on my second activity, cursor.first()
returns false!!!  All of the people are still in the database
(nothing's changed)... why would the query from my first activity
return the list of People, and an identical query return nothing?

I'm very puzzled.




Other Threads

1. Steps to transfer a simple object from server to android using XML


Could some one please tell me the basic steps that are required to
transfer a list of objects from a webserver to android and vice versa
using XML. I searched tutorials but found tutorials only for complex
RSS feeds or something like that.



2. navigation for nexus

aplikasi navigation untuk nexus yang bisa junction view apa ya?
Terutama untuk US map


"Indonesian Android Community [id-android]" 

3. Peta iGo

4. Eksibisi indosat di pejaten village

5. Widget time

6. Memory internal full

7. Available data from an InputStream from URLConnection?