diff options
author | naman14 <namandwivedi14@gmail.com> | 2015-05-16 18:38:14 +0530 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-05-20 23:18:24 +0000 |
commit | a91eaf774d0d867abaa2705e06550c2d2a115b99 (patch) | |
tree | e41c78bb0389fd145242648e18960452cf909e2c | |
parent | a8f6bffd8a871495bafba8a43dc732ee80faf6a1 (diff) | |
download | packages_apps_Contacts-a91eaf774d0d867abaa2705e06550c2d2a115b99.tar.gz packages_apps_Contacts-a91eaf774d0d867abaa2705e06550c2d2a115b99.tar.bz2 packages_apps_Contacts-a91eaf774d0d867abaa2705e06550c2d2a115b99.zip |
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
-rw-r--r-- | src/com/android/contacts/quickcontact/QuickContactActivity.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java index aea516b13..90a7fd6ff 100644 --- a/src/com/android/contacts/quickcontact/QuickContactActivity.java +++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java @@ -75,6 +75,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; @@ -2421,9 +2422,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); } |