Prevent crash

This commit is contained in:
M66B
2020-10-29 08:32:23 +01:00
parent 7aea1370ca
commit 26496c1341
4 changed files with 43 additions and 22 deletions

View File

@@ -483,6 +483,15 @@ public class Helper {
}
static void share(Context context, File file, String type, String name) {
try {
_share(context, file, type, name);
} catch (Throwable ex) {
// java.lang.IllegalArgumentException: Failed to resolve canonical path for ...
Log.e(ex);
}
}
static void _share(Context context, File file, String type, String name) {
// https://developer.android.com/reference/android/support/v4/content/FileProvider
Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);
Log.i("uri=" + uri);