diff options
author | xjiang <xjiang@codeaurora.org> | 2015-08-20 18:54:06 +0800 |
---|---|---|
committer | blong <blong@codeaurora.org> | 2015-09-11 10:36:56 +0800 |
commit | 069967983092cc50987e47605e398c8fe89c50ee (patch) | |
tree | 02f1f4dd52cf7e32cd9c678d8c6d166b322e0070 /src | |
parent | 8ea5ad185ded708c22f8723332ac84ae3ef78fc7 (diff) | |
download | android_packages_apps_ContactsCommon-069967983092cc50987e47605e398c8fe89c50ee.tar.gz android_packages_apps_ContactsCommon-069967983092cc50987e47605e398c8fe89c50ee.tar.bz2 android_packages_apps_ContactsCommon-069967983092cc50987e47605e398c8fe89c50ee.zip |
Supports to choose multi contacts when share visible contacts
- Let user can choose multi contacts when share visible contacts
Change-Id: Ib5fe5c3579062240f7be2eb8baddbea96e64622b
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/common/interactions/ImportExportDialogFragment.java | 41 | ||||
-rw-r--r-- | src/com/android/contacts/common/util/AccountsListAdapter.java | 2 |
2 files changed, 5 insertions, 38 deletions
diff --git a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java index f460cdaa..d37b93f1 100644 --- a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java +++ b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java @@ -305,43 +305,10 @@ public class ImportExportDialogFragment extends DialogFragment } private void doShareVisibleContacts() { - try { - // TODO move the query into a loader and do this in a background thread - final Cursor cursor = getActivity().getContentResolver().query(Contacts.CONTENT_URI, - LOOKUP_PROJECTION, Contacts.IN_VISIBLE_GROUP + "!=0", null, null); - if (cursor != null) { - try { - if (!cursor.moveToFirst()) { - Toast.makeText(getActivity(), R.string.share_error, Toast.LENGTH_SHORT) - .show(); - return; - } - - StringBuilder uriListBuilder = new StringBuilder(); - int index = 0; - do { - if (index != 0) - uriListBuilder.append(':'); - uriListBuilder.append(cursor.getString(0)); - index++; - } while (cursor.moveToNext()); - Uri uri = Uri.withAppendedPath( - Contacts.CONTENT_MULTI_VCARD_URI, - Uri.encode(uriListBuilder.toString())); - - final Intent intent = new Intent(Intent.ACTION_SEND); - intent.setType(Contacts.CONTENT_VCARD_TYPE); - intent.putExtra(Intent.EXTRA_STREAM, uri); - ImplicitIntentsUtil.startActivityOutsideApp(getActivity(), intent); - } finally { - cursor.close(); - } - } - } catch (Exception e) { - Log.e(TAG, "Sharing visible contacts failed", e); - Toast.makeText(getContext(), R.string.share_visible_contacts_failure, - Toast.LENGTH_SHORT).show(); - } + Intent intent = new Intent(SimContactsConstants.ACTION_MULTI_PICK); + intent.setType(Contacts.CONTENT_TYPE); + intent.putExtra(SimContactsConstants.IS_CONTACT,true); + getActivity().startActivityForResult(intent, SUBACTIVITY_SHARE_VISILBLE_CONTACTS); } /** diff --git a/src/com/android/contacts/common/util/AccountsListAdapter.java b/src/com/android/contacts/common/util/AccountsListAdapter.java index 575dddbd..19531ca2 100644 --- a/src/com/android/contacts/common/util/AccountsListAdapter.java +++ b/src/com/android/contacts/common/util/AccountsListAdapter.java @@ -79,7 +79,7 @@ public final class AccountsListAdapter extends BaseAdapter { private List<AccountWithDataSet> getAccounts(AccountListFilter accountListFilter) { if (accountListFilter == AccountListFilter.ACCOUNTS_GROUP_WRITABLE) { return new ArrayList<AccountWithDataSet>(mAccountTypes.getAccounts(true, - AccountTypeManager.FLAG_ALL_ACCOUNTS_WITHOUT_LOCAL)); + AccountTypeManager.FLAG_ALL_ACCOUNTS_WITHOUT_SIM)); } final List<AccountWithDataSet> writableAccountList = mAccountTypes .getAccounts(accountListFilter == AccountListFilter.ACCOUNTS_CONTACT_WRITABLE |