除了这个之外,Content Provider Media API 的公共方法对我来说看起来非常简单。我不确定这有什么作用或如何使用它。任何有关使用的见解将不胜感激。
您使用“内部”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");
CONTENT_AUTHORITY_SLASH
一样好content://media/
.
public static final String AUTHORITY = "media";
private static final String CONTENT_AUTHORITY_SLASH = "content://" + AUTHORITY + "/";
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)