From 65857af0ad1046680111f75c4a0bfe24ad4b9ee5 Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Tue, 17 Sep 2013 10:27:37 -0400 Subject: [PATCH] Bug 890392 - Replace the page title when sharing. r=sriram --- mobile/android/base/BrowserApp.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 52ffcd2b242..9b53f2a2b4b 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -1911,14 +1911,17 @@ abstract public class BrowserApp extends GeckoApp if (provider != null) { Intent shareIntent = provider.getIntent(); + // For efficiency, the provider's intent is only set once if (shareIntent == null) { - shareIntent = GeckoAppShell.getShareIntent(this, url, - "text/plain", tab.getDisplayTitle()); + shareIntent = new Intent(Intent.ACTION_SEND); + shareIntent.setType("text/plain"); provider.setIntent(shareIntent); - } else { - shareIntent.putExtra(Intent.EXTRA_TEXT, url); - shareIntent.putExtra(Intent.EXTRA_SUBJECT, tab.getDisplayTitle()); } + + // Replace the existing intent's extras + shareIntent.putExtra(Intent.EXTRA_TEXT, url); + shareIntent.putExtra(Intent.EXTRA_SUBJECT, tab.getDisplayTitle()); + shareIntent.putExtra(Intent.EXTRA_TITLE, tab.getDisplayTitle()); } }