]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
Updates about_licenses, adding the full text of the Apache License 2.0 and the 3...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / MainWebViewActivity.java
index a7dfad7e6831f198d03bded1742a29a58c1e51d6..353a8d16407ddb6f182921d15dc22916b250e951 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2017 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2015-2017 Soren Stoutner <soren@stoutner.com>.
  *
  * Download cookie code contributed 2017 Hendrik Knackstedt.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
  *
@@ -1236,10 +1236,21 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
                 return true;
 
             case R.id.share:
+                // Setup the share string.
+                String shareString;
+                if (webViewTitle != null) {
+                    shareString = webViewTitle + " – " + urlTextBox.getText().toString();
+                } else {
+                    shareString = urlTextBox.getText().toString();
+                }
+
+                // Create the share intent.
                 Intent shareIntent = new Intent();
                 shareIntent.setAction(Intent.ACTION_SEND);
-                shareIntent.putExtra(Intent.EXTRA_TEXT, urlTextBox.getText().toString());
+                shareIntent.putExtra(Intent.EXTRA_TEXT, shareString);
                 shareIntent.setType("text/plain");
+
+                // Make it so.
                 startActivity(Intent.createChooser(shareIntent, "Share URL"));
                 return true;