什么是MediaStore.Images.Media.getContentUri(字符串卷名):乌里呢? [英] What does MediaStore.Images.Media.getContentUri(String volumeName):Uri do?

查看:1411
本文介绍了什么是MediaStore.Images.Media.getContentUri(字符串卷名):乌里呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关内容提供商媒体API看pretty除了这一项的公共方法直截了当给我。我不知道这是什么一样,或如何使用它。在使用任何有识之士将AP preciated。

The public methods for the Content Provider Media API look pretty straight forward to me except for this one. I'm not sure what this does or how to use it. Any insight on usage would be appreciated.

推荐答案

您使用内部对 INTERNAL_CONTENT_URI 和外部的 EXTERNAL_CONTENT_URI ,所揭示的源$ C ​​$ C:

You use "internal" for INTERNAL_CONTENT_URI and "external" for EXTERNAL_CONTENT_URI, as revealed by the source code:

    /**
     * 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 一样好内容://媒体/

public static final String AUTHORITY = "media";

private static final String CONTENT_AUTHORITY_SLASH = "content://" + AUTHORITY + "/";

这篇关于什么是MediaStore.Images.Media.getContentUri(字符串卷名):乌里呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆