From 42075291ce17b85cfd6b1aac531ab420d94aa58f Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 8 Mar 2019 17:23:09 +0100 Subject: [PATCH] fix send log error on devices running Android 6 and lower --- src/main/java/io/lbry/browser/reactmodules/UtilityModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/lbry/browser/reactmodules/UtilityModule.java b/src/main/java/io/lbry/browser/reactmodules/UtilityModule.java index 5e470653..518eab02 100644 --- a/src/main/java/io/lbry/browser/reactmodules/UtilityModule.java +++ b/src/main/java/io/lbry/browser/reactmodules/UtilityModule.java @@ -186,6 +186,10 @@ public class UtilityModule extends ReactContextBaseJavaModule { if (fileUri != null) { Intent shareIntent = new Intent(); shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { + // Android 6 and lower + shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + } shareIntent.setAction(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_STREAM, fileUri);