From dd20085bc4c52e01798328389e2a8baf11df9533 Mon Sep 17 00:00:00 2001 From: Zhanty Date: Tue, 27 Aug 2019 14:13:40 +0800 Subject: [PATCH] update IntentUtils --- .../android/base/utils/android/XIntentUtils.java | 15 +++++++++++++++ lib_social/build.gradle | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java b/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java index 95c1186..a690091 100644 --- a/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java +++ b/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java @@ -7,11 +7,13 @@ import android.content.pm.ActivityInfo; import android.content.pm.ResolveInfo; import android.net.Uri; import android.provider.CalendarContract; +import android.provider.MediaStore; import android.provider.Settings; import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.Log; +import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Calendar; import java.util.List; @@ -147,4 +149,17 @@ public class XIntentUtils { } } + /** + * 通知系统有图片保存了 + */ + public static void notifyImageSaved(Context context, String path) { + //https://juejin.im/post/5ae0541df265da0b9d77e45a + try { + MediaStore.Images.Media.insertImage(context.getContentResolver(), path, "", ""); + context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + path))); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + } + } diff --git a/lib_social/build.gradle b/lib_social/build.gradle index d2905cd..58c391f 100644 --- a/lib_social/build.gradle +++ b/lib_social/build.gradle @@ -6,7 +6,6 @@ android { buildToolsVersion rootProject.buildToolsVersion defaultConfig { - minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion versionCode 1