tags:

views:

124

answers:

2

I am learning android developing. Well, my appwidget failed at this line:

Cursor cursor = context.getContentResolver().query(Contacts.CONTENT_URI,
                new String[] {Contacts.DISPLAY_NAME},
                Contacts.STARRED + "=0", null, null);

May I know why? Thanks.

Added: I have tried a few ways I used in Java to debug this line, all I got was "stop unexpectedly".

A: 

Here's a working example that retrieves all data based on name. I notice a couple of differences, so maybe you can compare and figure out your problem:

Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, "DISPLAY_NAME = '" + NAME + "'", null, null);

AndroidRef.com
This failed, either....
A: 

It turns out that I was wrong on where the problem was. Sorry guys.