mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Cosmetic changes
This commit is contained in:
parent
55440f8a18
commit
b6561c8b29
@ -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.
|
||||
|
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user