From 2f5932baa7bf1dd0715643e078e6dac6591383db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esvin=20Armando=20Gonz=C3=A1lez=20Monz=C3=B3n?= Date: Wed, 26 Jun 2019 14:50:13 -0600 Subject: [PATCH] Adding support to customize the authority value on FileProvider definition (AndroidManifest.xml). --- filebrowser/src/main/AndroidManifest.xml | 4 ++-- .../src/main/java/com/aditya/filebrowser/FileBrowser.java | 2 +- filebrowser/src/main/res/values/strings.xml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/filebrowser/src/main/AndroidManifest.xml b/filebrowser/src/main/AndroidManifest.xml index f4853f7..1166531 100644 --- a/filebrowser/src/main/AndroidManifest.xml +++ b/filebrowser/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ - \ No newline at end of file + diff --git a/filebrowser/src/main/java/com/aditya/filebrowser/FileBrowser.java b/filebrowser/src/main/java/com/aditya/filebrowser/FileBrowser.java index f26dccf..47cb0f5 100644 --- a/filebrowser/src/main/java/com/aditya/filebrowser/FileBrowser.java +++ b/filebrowser/src/main/java/com/aditya/filebrowser/FileBrowser.java @@ -216,7 +216,7 @@ public void onItemClick(View view, int position) { MimeTypeMap mimeMap = MimeTypeMap.getSingleton(); Intent openFileIntent = new Intent(Intent.ACTION_VIEW); String mimeType = mimeMap.getMimeTypeFromExtension(FilenameUtils.getExtension(f.getName())); - Uri uri = FileProvider.getUriForFile(mContext,"com.aditya.filebrowser.provider", f); + Uri uri = FileProvider.getUriForFile(mContext, mContext.getString(R.string.aditya_filebrowser_provider), f); openFileIntent.setDataAndType(uri,mimeType); openFileIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); openFileIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); diff --git a/filebrowser/src/main/res/values/strings.xml b/filebrowser/src/main/res/values/strings.xml index f7fe95f..e9936f4 100644 --- a/filebrowser/src/main/res/values/strings.xml +++ b/filebrowser/src/main/res/values/strings.xml @@ -1,5 +1,6 @@ File Browser + com.aditya.filebrowser.provider Cut Refresh Paste