gpt4 book ai didi

android - Android 中的 Uri 是什么?

转载 作者:行者123 更新时间:2023-11-29 15:15:59 25 4
gpt4 key购买 nike

这个问题可能看起来很愚蠢,但我正在写一篇关于 Android 相机 API 的论文。现在我正在考虑将图像保存在 SD 卡上,但我对 Uri 是什么和做什么有点困惑。它是否将图像从相机解析到 imageView?是图片的路径吗?

我找到了一个教程,但它没有描述 Uri 是什么。

代码中的Uri

Uri uri;

final static int MEDIA_TYPE_IMAGE = 1;

uri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);

public Uri getOutputMediaFileUri(int type) {
return Uri.fromFile(getOutputMediaFile(type));
}

最佳答案

URI 代表统一资源标识符。它基本上是一个文件的路径,或者是存储或网络上的资源。

getOutputMediaFileUri(MEDIA_TYPE_IMAGE); 从而获取存储图像的路径。

关于android - Android 中的 Uri 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23928844/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com