Skip to content

Commit

Permalink
saveBitmapToDir方法兼容android10
Browse files Browse the repository at this point in the history
  • Loading branch information
HuanTanSheng committed Jan 13, 2020
1 parent 78215a4 commit 37f229c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ allprojects {
```gradle
dependencies {
implementation 'com.github.HuanTanSheng:EasyPhotos:3.0.3' //androidx版本,支持android 10,永久维护
implementation 'com.github.HuanTanSheng:EasyPhotos:3.0.4' //androidx版本,支持android 10,永久维护
//implementation 'com.github.HuanTanSheng:EasyPhotos:2.4.5' //还没有升级到androidx的同学可以用这个版本,但不支持android 10,暂停维护
 
Expand Down Expand Up @@ -154,6 +154,9 @@ QQ交流群:[288600953](https://jq.qq.com/?_wv=1027&k=5QGgCDe)


## 更新日志
**3.0.4:**
- 优化:saveBitmapToDir方法兼容andorid10

**3.0.3:**
- 修复:修复华为nova 5i pro 在相机页面点击返回时产生的崩溃问题 #87

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ private static void saveBitmapToDirQ(final Activity act, final String dirPath,
final boolean notifyMedia,
final SaveBitmapCallBack callBack) {
long dataTake = System.currentTimeMillis();
String jpegName = namePrefix + dataTake + ".jpg";
String jpegName = namePrefix + dataTake + ".png";

ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.DISPLAY_NAME, jpegName);
values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
values.put(MediaStore.Images.Media.MIME_TYPE, "image/png");
int dirIndex = dirPath.lastIndexOf("/");
if (dirIndex == dirPath.length()) {
String dirPath2 = dirPath.substring(0, dirIndex - 1);
Expand Down

0 comments on commit 37f229c

Please sign in to comment.