From 7ee5e0f39bc5f587f6dc6269f1bdfd3a4ef87e95 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Sun, 2 Oct 2016 12:55:05 +0200 Subject: [PATCH] Get title for image sharing dialog from resources instead of using hardcoded string. Also do not show multiple permission dialogs stacked --- .../github/dfa/diaspora_android/ui/ContextMenuWebView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java index 92394bef..3be4ce63 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java @@ -141,9 +141,10 @@ public class ContextMenuWebView extends NestedWebView { }) .setNegativeButton(context.getText(android.R.string.no), null) .show(); + } else { + parentActivity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, + MainActivity.REQUEST_CODE__ACCESS_EXTERNAL_STORAGE); } - parentActivity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, - MainActivity.REQUEST_CODE__ACCESS_EXTERNAL_STORAGE); } } if (writeToStoragePermitted) { @@ -157,7 +158,7 @@ public class ContextMenuWebView extends NestedWebView { sharingIntent.putExtra(Intent.EXTRA_STREAM, myUri); sharingIntent.setType("image/png"); sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - context.startActivity(Intent.createChooser(sharingIntent, "Share image using")); + context.startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.action_share_dotdotdot))); } }.execute(url); }