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