fix send log error on devices running Android 6 and lower #469
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue