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. [WTA] Game multi user

Pagi semua.
Suhu-suhu semua mau tanya dong, dari kemarin cari-cari blm ketemu. :(

Ada yang tahu gak game yang bisa di mainin bareng2?
Klo bisa yang tarung2 gitu.

Best Regards
Muhammad Amiral

send from `Karyo` bin SamTab


2. Samsung fit vs LG opt p500

As subject..

Bagusan mana yah?

Mohon masukan Rekan2 untuk nyubi yg satu ini..maaf klo sudah prnh dibhas...:)



3. Activity Lifecycle Documentation Question

4. android navitel navigator

5. Porting Android on Freescale IMX31 board

6. Why did you chose this OS platform over other ones?

7. When exactly do you need to handle DeadObjectException with services?