From c6a53cf899405236a7c42aefce7d9e30e675094e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=20=E5=AE=B6=20=E6=B5=A9?= <35959817+Jahhow@users.noreply.github.com> Date: Sat, 11 Apr 2020 14:01:36 +0800 Subject: [PATCH] Fixes kollerlukas/Camera-Roll-Android-App#270 using MediaProvider.dataChanged --- .../java/us/koller/cameraroll/data/provider/Provider.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/us/koller/cameraroll/data/provider/Provider.java b/app/src/main/java/us/koller/cameraroll/data/provider/Provider.java index 6ccb9332..7d291aa4 100644 --- a/app/src/main/java/us/koller/cameraroll/data/provider/Provider.java +++ b/app/src/main/java/us/koller/cameraroll/data/provider/Provider.java @@ -168,6 +168,7 @@ public static void pinPath(Context context, String path) { if (!pinnedPaths.contains(path)) { pinnedPaths.add(path); + MediaProvider.dataChanged = true; } } @@ -175,8 +176,10 @@ public static void unpinPath(Context context, String path) { if (pinnedPaths == null) { pinnedPaths = loadPinnedPaths(context); } - - pinnedPaths.remove(path); + if (pinnedPaths.contains(path)) { + MediaProvider.dataChanged = true; + pinnedPaths.remove(path); + } } public static ArrayList loadPinnedPaths(Context context) {