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 开发者_如何学Pythonused in Java to debug this line, all I got was "stop unexpectedly".
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);
精彩评论