From 79dd948ef27dea1151cf2ef952292e1d8fc3da70 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sun, 23 Feb 2014 18:28:33 +0100 Subject: [PATCH] This activity belongs to us - no need to ask package manager for its label --- .../com/cradle/iitc_mobile/share/IntentGenerator.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java b/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java index b315cc13..b4b68893 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java +++ b/mobile/src/com/cradle/iitc_mobile/share/IntentGenerator.java @@ -9,6 +9,7 @@ import android.content.pm.ResolveInfo; import android.net.Uri; import com.cradle.iitc_mobile.Log; +import com.cradle.iitc_mobile.R; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -146,11 +147,9 @@ public class IntentGenerator { if (!containsCopyIntent(targets)) { // add SendToClipboard intent in case Drive is not installed - Intent copyToClipboardIntent = new Intent(intent); - copyToClipboardIntent.setComponent(new ComponentName(mContext, SendToClipboard.class)); - ResolveInfo activity = mPackageManager.resolveActivity(copyToClipboardIntent, 0); - copyToClipboardIntent.putExtra(EXTRA_FLAG_TITLE, activity.loadLabel(mPackageManager)); - targets.add(copyToClipboardIntent); + targets.add(new Intent(intent) + .setComponent(new ComponentName(mContext, SendToClipboard.class)) + .putExtra(EXTRA_FLAG_TITLE, mContext.getString(R.string.activity_share_to_clipboard))); } return targets;