yzcheng90

yzcheng90

Member Since 4 years ago

cs

Experience Points
84
follower
Lessons Completed
7
follow
Lessons Completed
280
stars
Best Reply Awards
23
repos

28 contributions in the last year

Pinned
⚡ X-SpringBoot是一个轻量级的Java快速开发平台,能快速开发项目并交付【接私活利器】
⚡ 🔥MS 是一个前后分离的分布式 spring cloud 框架(全家桶),这里有统一认证,统一网关等等功能,是一个非常简洁的微服务脚手架
⚡ springboot 基于Hikari 动态数据源 https://github.com/yzcheng90/dynamic-data-source
⚡ 自动填充属性框架
Activity
Aug
26
1 month ago
Activity icon
issue

yzcheng90 issue comment Justson/AgentWeb

yzcheng90
yzcheng90

Android11 打开相册选择图片返回后无法显示。

Android11 打开相册选择图片返回后无法显示。拍照没有问题 报错: E/DatabaseUtils: Writing exception to parcel java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/image%3A35 from pid=25351, uid=10155 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs

现使用代码:

private Intent getFileChooserIntent() {
	Intent mIntent = null;
	if (mIsAboveLollipop && mFileChooserParams != null && (mIntent = mFileChooserParams.createIntent()) != null) {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && mIntent.getAction().equals(Intent.ACTION_GET_CONTENT)) {
			mIntent.setAction(Intent.ACTION_OPEN_DOCUMENT);
		}
		return mIntent;
	}

	Intent i = new Intent();
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
		i.setAction(Intent.ACTION_OPEN_DOCUMENT);
	} else {
		i.setAction(Intent.ACTION_GET_CONTENT);
	}
	i.addCategory(Intent.CATEGORY_OPENABLE);
	if (TextUtils.isEmpty(this.mAcceptType)) {
		i.setType("*/*");
	} else {
		i.setType(this.mAcceptType);
	}
	i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
	return mIntent = Intent.createChooser(i, "");
}
yzcheng90
yzcheng90

老哥,完整代码可以贴一下吗

Aug
20
2 months ago
started
started time in 2 months ago
Aug
19
2 months ago
started
started time in 2 months ago