For content URIs that point to a row or rows of table data, getType() should return a MIME type in Android's vendor-specific MIME format:
- Type part:
vnd - Subtype part:
- If the URI pattern is for a single row:
android.cursor.item/ - If the URI pattern is for more than one row:
android.cursor.dir/
- If the URI pattern is for a single row:
- Provider-specific part:
vnd.<name>.<type>You supply the
<name>and<type>. The<name>value should be globally unique, and the<type>value should be unique to the corresponding URI pattern. A good choice for<name>is your company's name or some part of your application's Android package name. A good choice for the<type>is a string that identifies the table associated with the URI.
android:grantUriPermssions: Temporary permission flag.android:permission: Single provider-wide read/write permission.android:readPermission: Provider-wide read permission.android:writePermission: Provider-wide write permission.
Permissions and their corresponding attributes are described in more detail in the section Implementing Content Provider Permissions.
本文详细介绍了在Android中为Content Provider URI设置MIME类型的原理、格式和最佳实践,包括如何选择合适的名称和类型,以及如何配置权限以确保应用程序间的数据安全。
&spm=1001.2101.3001.5002&articleId=50086247&d=1&t=3&u=5bc9c263c05d4e82a31f52fba216e6f6)
487

被折叠的 条评论
为什么被折叠?



