aboutsummaryrefslogtreecommitdiffstats
path: root/cgeo-contacts
diff options
context:
space:
mode:
authorMichael Keppler <michael.keppler@gmx.de>2014-04-22 09:16:48 +0200
committerMichael Keppler <michael.keppler@gmx.de>2014-04-22 09:16:48 +0200
commit2bb1067d303b9723428089fa035fb5f8d54d1b61 (patch)
tree971282139bc44ecc0b89fdcce4492de0dd6f1be1 /cgeo-contacts
parentbd9851163db66bf4fce843ab133a30aa07dfe3ec (diff)
downloadcgeo-2bb1067d303b9723428089fa035fb5f8d54d1b61.zip
cgeo-2bb1067d303b9723428089fa035fb5f8d54d1b61.tar.gz
cgeo-2bb1067d303b9723428089fa035fb5f8d54d1b61.tar.bz2
rename method to reflect what it does
Diffstat (limited to 'cgeo-contacts')
-rw-r--r--cgeo-contacts/src/cgeo/contacts/ContactsActivity.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java b/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java
index fa24a59..f1db7cf 100644
--- a/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java
+++ b/cgeo-contacts/src/cgeo/contacts/ContactsActivity.java
@@ -42,17 +42,17 @@ public final class ContactsActivity extends Activity {
}
// search by nickname, exact
- List<Pair<Integer, String>> contacts = getContactId(nickName, ContactsContract.Data.CONTENT_URI, ContactsContract.Data.CONTACT_ID, ContactsContract.CommonDataKinds.Nickname.NAME, false);
+ List<Pair<Integer, String>> contacts = getContacts(nickName, ContactsContract.Data.CONTENT_URI, ContactsContract.Data.CONTACT_ID, ContactsContract.CommonDataKinds.Nickname.NAME, false);
// search by display name, exact
if (contacts.isEmpty()) {
- contacts = getContactId(nickName, ContactsContract.Contacts.CONTENT_URI, BaseColumns._ID, ContactsContract.Contacts.DISPLAY_NAME, false);
+ contacts = getContacts(nickName, ContactsContract.Contacts.CONTENT_URI, BaseColumns._ID, ContactsContract.Contacts.DISPLAY_NAME, false);
}
// search by contained name parts
if (contacts.isEmpty()) {
- contacts.addAll(getContactId(nickName, ContactsContract.Data.CONTENT_URI, ContactsContract.Data.CONTACT_ID, ContactsContract.CommonDataKinds.Nickname.NAME, true));
- contacts.addAll(getContactId(nickName, ContactsContract.Contacts.CONTENT_URI, BaseColumns._ID, ContactsContract.Contacts.DISPLAY_NAME, true));
+ contacts.addAll(getContacts(nickName, ContactsContract.Data.CONTENT_URI, ContactsContract.Data.CONTACT_ID, ContactsContract.CommonDataKinds.Nickname.NAME, true));
+ contacts.addAll(getContacts(nickName, ContactsContract.Contacts.CONTENT_URI, BaseColumns._ID, ContactsContract.Contacts.DISPLAY_NAME, true));
}
if (contacts.isEmpty()) {
@@ -97,7 +97,7 @@ public final class ContactsActivity extends Activity {
finish();
}
- private List<Pair<Integer, String>> getContactId(final @NonNull String searchName, Uri uri, final @NonNull String idColumnName, final @NonNull String selectionColumnName, boolean like) {
+ private List<Pair<Integer, String>> getContacts(final @NonNull String searchName, Uri uri, final @NonNull String idColumnName, final @NonNull String selectionColumnName, boolean like) {
final String[] projection = new String[] { idColumnName, selectionColumnName };
final String selection = selectionColumnName + (like ? " LIKE" : " =") + " ? COLLATE NOCASE";
final String[] selectionArgs = new String[] { like ? "%" + searchName + "%" : searchName };