diff options
author | Alan Jones <skyphyr@gmail.com> | 2009-05-21 12:32:17 +1000 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2009-07-07 12:40:15 -0700 |
commit | 81a476f654155df27aa564a4aebf931eab588e6d (patch) | |
tree | cfd00115ae2076ec9cf26065c2f7c6b5e899f7a2 /core/java/android/content/ContentProvider.java | |
parent | f6737d3ae0f0ca49112807502cc0a272febf3b35 (diff) | |
download | frameworks_base-81a476f654155df27aa564a4aebf931eab588e6d.zip frameworks_base-81a476f654155df27aa564a4aebf931eab588e6d.tar.gz frameworks_base-81a476f654155df27aa564a4aebf931eab588e6d.tar.bz2 |
Fixed Issue 2682: ContentProvider query() SDK docs deprecated
Diffstat (limited to 'core/java/android/content/ContentProvider.java')
-rw-r--r-- | core/java/android/content/ContentProvider.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 4e631c4..4c7a9d3 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -314,9 +314,10 @@ public abstract class ContentProvider implements ComponentCallbacks { * Example client call:<p> * <pre>// Request a specific record. * Cursor managedCursor = managedQuery( - Contacts.People.CONTENT_URI.addId(2), + ContentUris.withAppendedId(Contacts.People.CONTENT_URI, 2), projection, // Which columns to return. null, // WHERE clause. + null, // WHERE clause value substitution People.NAME + " ASC"); // Sort order.</pre> * Example implementation:<p> * <pre>// SQLiteQueryBuilder is a helper class that creates the @@ -345,15 +346,18 @@ public abstract class ContentProvider implements ComponentCallbacks { return c;</pre> * * @param uri The URI to query. This will be the full URI sent by the client; - * if the client is requesting a specific record, the URI will end in a record number - * that the implementation should parse and add to a WHERE or HAVING clause, specifying - * that _id value. + * if the client is requesting a specific record, the URI will end in a record number + * that the implementation should parse and add to a WHERE or HAVING clause, specifying + * that _id value. * @param projection The list of columns to put into the cursor. If * null all columns are included. * @param selection A selection criteria to apply when filtering rows. * If null then all rows are included. + * @param selectionArgs You may include ?s in selection, which will be replaced by + * the values from selectionArgs, in order that they appear in the selection. + * The values will be bound as Strings. * @param sortOrder How the rows in the cursor should be sorted. - * If null then the provider is free to define the sort order. + * If null then the provider is free to define the sort order. * @return a Cursor or null. */ public abstract Cursor query(Uri uri, String[] projection, |