Cosmetic changes

This commit is contained in:
cketti 2011-03-24 04:04:13 +01:00
parent 55440f8a18
commit b6561c8b29
2 changed files with 11 additions and 15 deletions

View File

@ -225,30 +225,30 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts {
@Override
public Intent contactPickerIntent() {
return new Intent(Intent.ACTION_PICK, Contacts.People.CONTENT_URI);
}
@Override
public String getEmailFromContactPicker(final Intent data) {
Cursor cursor = null;
Cursor cursor2 = null;
String email = "";
try {
Uri result = data.getData();
cursor = mContentResolver.query(result, null, null, null, null);
cursor = mContentResolver.query(result, null, null, null, null);
if (cursor.moveToFirst()) {
String emailId = cursor.getString(cursor.getColumnIndex(Contacts.People.PRIMARY_EMAIL_ID));
cursor2 = mContext.getContentResolver().query(ContactMethods.CONTENT_EMAIL_URI, new String[] { ContactMethods.DATA }, "contact_methods._id=?", new String[] { emailId }, null);
cursor2 = mContext.getContentResolver().query(
ContactMethods.CONTENT_EMAIL_URI,
new String[] { ContactMethods.DATA },
"contact_methods._id=?",
new String[] { emailId },
null);
if (cursor2.moveToFirst()) {
email = cursor2.getString(0);
}
}
} catch (Exception e) {
Log.e(K9.LOG_TAG, "Failed to get email data", e);
} finally {
@ -263,8 +263,6 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts {
return email;
}
/**
* Return a {@link Cursor} instance that can be used to fetch information
* about the contact with the given email address.

View File

@ -192,22 +192,20 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts {
}
}
@Override
public Intent contactPickerIntent() {
return new Intent(Intent.ACTION_PICK, android.provider.ContactsContract.Contacts.CONTENT_URI);
return new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
}
@Override
public String getEmailFromContactPicker(final Intent data) {
Cursor cursor = null;
String email = "";
try {
Uri result = data.getData();
Log.v(K9.LOG_TAG, "Got a contact result: " + result.toString());
// get the contact id from the Uri
// Get the contact id from the Uri
String id = result.getLastPathSegment();
cursor = mContentResolver.query(Email.CONTENT_URI,
null, Email.CONTACT_ID + "=?", new String[] { id },