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. Update in Content Provider

If I don't need the Update method in a Content Provider, how do I
alert others using it? I can just leave the method empty, but what
other precautions should I take?

- Juan T.

2. Incognito is back!!!

So, I'm finally back!!! I'm done with my app for the iPhone and
finally have some time to spare to this forum.

First of all, congratulations are in order. Muthu, you bastard, your
App won $100K. Well, congratulations to you.

So what happened after I lost the challenge? Well, had the carton box
near my desk been alive, I would currently be guilty of {*filter*}. :)

Right, after loosing the challenge I started to work {*filter*} my IPhone
app. It was like hell and several times I wanted to quit but I finally
completed it. Well it is now in the AppStore. Unfortunately, because
I'm incognito, I cannot tell you which one it is. I was thinking about
submitting it to SlideMe or some of the other Android apps but first I
will see if it is even worth it.

Anyway, just wanted to say hi to you guys, specially Muthu, Shane,
Peli and other Android hard cores.

Hopefully they'll announce challenge 2 soon. I'm ready for some action

3. OI Shopping list

4. Issue with Calendar APIs

5. RingtoneManager

6. Long Clickable View

7. How do I get an instance of to read the attributes on my manifest file?