Merge "Docs: Fixed an invalid initialization of ExampleProvider member in Content URI patterns docs sample" into mnc-io-docs
This commit is contained in:
@@ -409,13 +409,14 @@ page.title=Creating a Content Provider
|
|||||||
public class ExampleProvider extends ContentProvider {
|
public class ExampleProvider extends ContentProvider {
|
||||||
...
|
...
|
||||||
// Creates a UriMatcher object.
|
// Creates a UriMatcher object.
|
||||||
private static final UriMatcher sUriMatcher;
|
private static final UriMatcher sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
|
||||||
...
|
|
||||||
|
static {
|
||||||
/*
|
/*
|
||||||
* The calls to addURI() go here, for all of the content URI patterns that the provider
|
* The calls to addURI() go here, for all of the content URI patterns that the provider
|
||||||
* should recognize. For this snippet, only the calls for table 3 are shown.
|
* should recognize. For this snippet, only the calls for table 3 are shown.
|
||||||
*/
|
*/
|
||||||
...
|
|
||||||
/*
|
/*
|
||||||
* Sets the integer value for multiple rows in table 3 to 1. Notice that no wildcard is used
|
* Sets the integer value for multiple rows in table 3 to 1. Notice that no wildcard is used
|
||||||
* in the path
|
* in the path
|
||||||
@@ -428,6 +429,7 @@ public class ExampleProvider extends ContentProvider {
|
|||||||
* "content://com.example.app.provider/table3 doesn't.
|
* "content://com.example.app.provider/table3 doesn't.
|
||||||
*/
|
*/
|
||||||
sUriMatcher.addURI("com.example.app.provider", "table3/#", 2);
|
sUriMatcher.addURI("com.example.app.provider", "table3/#", 2);
|
||||||
|
}
|
||||||
...
|
...
|
||||||
// Implements ContentProvider.query()
|
// Implements ContentProvider.query()
|
||||||
public Cursor query(
|
public Cursor query(
|
||||||
|
|||||||
Reference in New Issue
Block a user