mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-17 06:55:03 -05:00
Simplify Contacts API
This commit is contained in:
parent
0ca6adfbf8
commit
052695af83
@ -2,7 +2,6 @@ package com.fsck.k9.helper;
|
|||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@ -131,7 +130,7 @@ public abstract class Contacts
|
|||||||
* the instance also contains the (display) name of that
|
* the instance also contains the (display) name of that
|
||||||
* entity.
|
* entity.
|
||||||
*/
|
*/
|
||||||
public abstract void createContact(Activity activity, Address email);
|
public abstract void createContact(Address email);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the provided email address belongs to one of the contacts.
|
* Check whether the provided email address belongs to one of the contacts.
|
||||||
|
@ -65,7 +65,7 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createContact(final Activity activity, final Address email)
|
public void createContact(final Address email)
|
||||||
{
|
{
|
||||||
final Uri contactUri = Uri.fromParts("mailto", email.getAddress(), null);
|
final Uri contactUri = Uri.fromParts("mailto", email.getAddress(), null);
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
|
|||||||
contactIntent.putExtra(Contacts.Intents.Insert.NAME, senderPersonal);
|
contactIntent.putExtra(Contacts.Intents.Insert.NAME, senderPersonal);
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.startActivity(contactIntent);
|
mContext.startActivity(contactIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,7 +2,6 @@ package com.fsck.k9.helper;
|
|||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.accounts.AccountManager;
|
import android.accounts.AccountManager;
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@ -69,7 +68,7 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createContact(final Activity activity, final Address email)
|
public void createContact(final Address email)
|
||||||
{
|
{
|
||||||
final Uri contactUri = Uri.fromParts("mailto", email.getAddress(), null);
|
final Uri contactUri = Uri.fromParts("mailto", email.getAddress(), null);
|
||||||
|
|
||||||
@ -87,7 +86,7 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts
|
|||||||
contactIntent.putExtra(Intents.Insert.NAME, senderPersonal);
|
contactIntent.putExtra(Intents.Insert.NAME, senderPersonal);
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.startActivity(contactIntent);
|
mContext.startActivity(contactIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user