From 72dd839e5bb1c5940693b3755ff566b0b5f2f259 Mon Sep 17 00:00:00 2001 From: naman14 Date: Sat, 16 May 2015 18:38:14 +0530 Subject: fix crash in QuickContact on sending contact via sms Open QuickContact for any contact->Send Contact via sms- ActivityNotFound Exception This is still using the previous vnd.android-dir/mms-sms which wouldn't work on kitkat above Change-Id: I63dcf38c20f11d0ce023cf29138d49036500fcde --- src/com/android/contacts/quickcontact/QuickContactActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java index 2f0230f36..ecd1f9c32 100644 --- a/src/com/android/contacts/quickcontact/QuickContactActivity.java +++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java @@ -73,6 +73,7 @@ import android.provider.ContactsContract.DataUsageFeedback; import android.provider.ContactsContract.Intents; import android.provider.ContactsContract.QuickContact; import android.provider.ContactsContract.RawContacts; +import android.provider.Telephony; import android.support.v7.graphics.Palette; import android.telecom.PhoneAccount; import android.telecom.TelecomManager; @@ -2778,9 +2779,13 @@ public class QuickContactActivity extends ContactsActivity { + ":" + organization + "\r\n"; sipAddress = (sipAddress == null) ? "" : getString(R.string.label_sip_address) + ":" + sipAddress + "\r\n"; - Intent intent = new Intent(Intent.ACTION_VIEW); + String defaultSmsPackageName = Telephony.Sms.getDefaultSmsPackage(this); + Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra("sms_body", name + phone + email + postal + organization + sipAddress); - intent.setType("vnd.android-dir/mms-sms"); + intent.setType("text/plain"); + if (defaultSmsPackageName != null) { + intent.setPackage(defaultSmsPackageName); + } startActivity(intent); } -- cgit v1.2.3