aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/providers
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-27 14:41:25 +0200
committerlookshe <github@lookshe.org>2016-03-27 14:41:25 +0200
commit9773b16a98c946e42d39afccc6255e1f1f611aed (patch)
tree29cfd7da24995e853044d01e10a7f73e8c0f5e87 /src/main/java/de/thedevstack/conversationsplus/providers
parent711ab9f2b1b625373a7046774c7b78e59f826589 (diff)
Fixes FS#166 - Images cannot be opened since storing in private image folder
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/providers')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/providers/ConversationsPlusFileProvider.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/providers/ConversationsPlusFileProvider.java b/src/main/java/de/thedevstack/conversationsplus/providers/ConversationsPlusFileProvider.java
new file mode 100644
index 00000000..a718b161
--- /dev/null
+++ b/src/main/java/de/thedevstack/conversationsplus/providers/ConversationsPlusFileProvider.java
@@ -0,0 +1,20 @@
+package de.thedevstack.conversationsplus.providers;
+
+import android.net.Uri;
+import android.support.v4.content.FileProvider;
+
+import de.thedevstack.conversationsplus.ConversationsPlusApplication;
+import de.thedevstack.conversationsplus.entities.DownloadableFile;
+
+/**
+ * Created by lookshe on 27.03.16.
+ */
+public class ConversationsPlusFileProvider extends FileProvider {
+
+ private static final String SCHEME = "content";
+ private static final String AUTHORITY = "de.thedevstack.conversationsplus";
+
+ public static Uri createUriForPrivateFile(DownloadableFile file) {
+ return FileProvider.getUriForFile(ConversationsPlusApplication.getAppContext(), AUTHORITY, file);
+ }
+}