更新时间:2023-12-06 11:41:10
请尝试使用 Intent.EXTRA_LOCAL_ONLY 喜欢intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
如果您设备中的图库应用支持,则只会显示本地存储中的文件.如果图库应用不支持上述意图,您可以在检查图库应用返回的文件路径的文件长度后向用户显示错误消息.
Please try using Intent.EXTRA_LOCAL_ONLY like intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
If the gallery app in your device supports it, only files in local storage will be displayed. If the gallery app does not support the above intent, you can show an error message to the user after checking the file length of the returned file path from gallery app.