Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
c12aa3dd
Commit
c12aa3dd
authored
Jul 27, 2022
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 安卓sdk升级往相册存储图片,判断是否大于29
parent
d67e2f08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
config.gradle
config.gradle
+1
-1
ImageUtil.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ImageUtil.java
+9
-3
No files found.
config.gradle
View file @
c12aa3dd
...
...
@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.41.
59
"
,
"ydl-platform"
:
"0.0.41.
60
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.57"
,
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ImageUtil.java
View file @
c12aa3dd
...
...
@@ -4,6 +4,7 @@ import android.content.Context;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Environment
;
import
android.util.Base64
;
import
com.yidianling.common.tools.ToastUtil
;
...
...
@@ -14,9 +15,14 @@ public class ImageUtil {
public
static
boolean
savePicture
(
Context
context
,
String
base64DataStr
)
{
// 去掉base64中的前缀
// String base64Str = base64DataStr.substring(base64DataStr.indexOf(",")+1, base64DataStr.length());
File
appDir
=
new
File
(
Environment
.
getExternalStorageDirectory
(),
"Camera"
);
// 图片保存的文件夹的名称
File
file
;
if
(
Build
.
VERSION
.
SDK_INT
>
29
)
{
// Android 11 获取存储路径错误 android.system.ErrnoException: open failed: EPERM (Operation not permitted),Android11 不能获取sdcard通用空间路径
file
=
context
.
getExternalFilesDir
(
null
);
}
else
{
file
=
Environment
.
getExternalStorageDirectory
();
}
File
appDir
=
new
File
(
file
,
"Camera"
);
// 图片保存的文件夹的名称
if
(!
appDir
.
exists
())
{
appDir
.
mkdir
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment