Changes

Understanding Android 6 Content Providers

12 bytes removed, 08:08, 28 January 2016
m
Text replacement - "<google>BUY_ANDROID_STUDIO6</google>" to "<htmlet>androidstudio_a6</htmlet>"
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
This method is called when the content provider is first created and should be used to perform any initialization tasks required by the content provider.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
=== query() ===
com.example.mydbapp.myprovider/products/3
</pre>
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
When implementing the insert, query, update and delete methods in the content provider, it will be the responsibility of these methods to identify whether the incoming URI is targeting a specific row in a table, or references multiple rows and act accordingly. This can potentially be a complex task given that a URI can extend to multiple levels. This process can, however, be eased significantly by making use of the UriMatcher class as will be outlined in the next chapter.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>