pub struct QueriesProvider {
pub authorities: AttributeList<Semicolon, String>,
pub name: String,
}
Expand description
Declares a content provider component used in <queries>
.
A content provider is a subclass of ContentProvider
that supplies structured
access to data managed by the application. All content providers in your application
must be defined in a <provider>
element in the manifest file; otherwise, the system
is unaware of them and doesn’t run them.
You only declare content providers that are part of your application. Content providers in other applications that you use in your application should not be declared.
The Android system stores references to content providers according to an authority
string, part of the provider’s content URI. For example, suppose you want to access a
content provider that stores information about health care professionals.
To do this, you call the method ContentResolver.query()
,
which among other arguments takes a URI that identifies the provider:
§XML Example
content://com.example.project.healthcareprovider/nurses/rn
The content:
scheme
identifies the URI as a content URI pointing to an Android
content provider. The authority com.example.project.healthcareprovider
identifies
the provider itself; the Android system looks up the authority in its list of known
providers and their authorities. The substring nurses/rn
is a path
, which the
content provider can use to identify subsets of the provider data.
In cases where you need to query a content provider but don’t know the specific
package names, you can declare that provider authority in a
§XML Example
<manifest package="com.example.suite.enterprise">
<queries>
<provider android:authorities="com.example.settings.files" />
</queries>
...
</manifest>
§Node
If your Preparing your Gradle build for package visibility in Android 11
.
§Contained in
§Introduced in
API Level 30
Fields§
A list of one or more URI authorities that identify data offered by the content
provider. Multiple authorities are listed by separating their names with a
semicolon. To avoid conflicts, authority names should use a Java-style naming
convention (such as com.example.provider.cartoonprovider). Typically, it’s the
name of the ContentProvider
subclass that implements the provider
There is no default. At least one authority must be specified.
name: String
The name of the class that implements the content provider, a subclass of
ContentProvider
. This should be a fully qualified class name (such
as, "com.example.project.TransportationProvider"
). However, as a
shorthand, if the first character of the name is a period, it is
appended to the package name specified in the <manifest>
element.
There is no default. The name must be specified.
Implementations§
Trait Implementations§
Source§impl Clone for QueriesProvider
impl Clone for QueriesProvider
Source§fn clone(&self) -> QueriesProvider
fn clone(&self) -> QueriesProvider
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more