除此之外,Content Provider Media API的公共方法看起来非常简单.我不确定这是做什么或如何使用它.任何有关使用的见解将不胜感激.
小智 5
如源代码所示,您使用“内部”为INTERNAL_CONTENT_URI和“外部”为EXTERNAL_CONTENT_URI:
/**
* Get the content:// style URI for the image media table on the
* given volume.
*
* @param volumeName the name of the volume to get the URI for
* @return the URI to the image media table on the given volume
*/
public static Uri getContentUri(String volumeName) {
return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName +
"/images/media");
}
/**
* The content:// style URI for the internal storage.
*/
public static final Uri INTERNAL_CONTENT_URI =
getContentUri("internal");
/**
* The content:// style URI for the "primary" external storage
* volume.
*/
public static final Uri EXTERNAL_CONTENT_URI =
getContentUri("external");
Run Code Online (Sandbox Code Playgroud)
CONTENT_AUTHORITY_SLASH一样好content://media/。
public static final String AUTHORITY = "media";
private static final String CONTENT_AUTHORITY_SLASH = "content://" + AUTHORITY + "/";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6620 次 |
| 最近记录: |