Extracted string resource for clipboard toast

This commit is contained in:
PaulStets 2018-01-27 13:46:23 +02:00
parent fa1bd1b938
commit 3f2dfee22d
2 changed files with 2 additions and 1 deletions

View file

@ -2858,4 +2858,5 @@
<string name="nautical_renderer">Nautical</string> <string name="nautical_renderer">Nautical</string>
<string name="copy_location_name">Copy Point/POI name</string> <string name="copy_location_name">Copy Point/POI name</string>
<string name="toast_empty_name_error">Location has no name</string> <string name="toast_empty_name_error">Location has no name</string>
<string name="clipboard_message">Copied to clipboard</string>
</resources> </resources>

View file

@ -216,7 +216,7 @@ public class ShareDialog {
public static void sendToClipboard(Activity activity, String text) { public static void sendToClipboard(Activity activity, String text) {
ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Activity.CLIPBOARD_SERVICE); ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Activity.CLIPBOARD_SERVICE);
clipboard.setText(text); clipboard.setText(text);
Toast.makeText(activity, "Copied to clipboard", Toast.LENGTH_LONG) Toast.makeText(activity, R.string.clipboard_message, Toast.LENGTH_LONG)
.show(); .show();
} }
} }