i have problem with managedQuery ,too.
from document we know Parameters :
uri The URI of the content provider to query.
projection List of columns to return.
selection SQL WHERE clause.
selectionArgs The arguments to selection, if any ?s are pesent
sortOrder SQL ORDER BY clause.
i want to query the contact, select whose name is User and show the
id
how do i write the query string ??
i thought maybe :
String queryResult[]= new String[] {People._ID};
String queryStr = People.NUMBER + " is not null and " + People.NAME +
"="+"User";
Cursor c = getContentResolver().query(
People.CONTENT_URI,
queryResult,
querystr,
null,
People.DISPLAY_NAME + " asc");
but the error log :
03-05 13:31:52.736: ERROR/DatabaseUtils(90):
android.database.sqlite.SQLiteException: no such column: User: ,
while compiling: SELECT people._id AS _id FROM people LEFT OUTER JOIN
phones ON people.primary_phone=phones._id LEFT OUTER JOIN presence ON
(presence.person=people._id) WHERE (name=Anderson) ORDER BY
display_name asc
can anyone explain this error log ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---