Simplify Contacts API
This commit is contained in:
parent
0ca6adfbf8
commit
052695af83
3 changed files with 5 additions and 7 deletions
|
@ -2,7 +2,6 @@ package com.fsck.k9.helper;
|
|||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import android.app.Activity;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
|
@ -131,7 +130,7 @@ public abstract class Contacts
|
|||
* the instance also contains the (display) name of that
|
||||
* 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.
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
|
|||
}
|
||||
|
||||
@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);
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
|
|||
contactIntent.putExtra(Contacts.Intents.Insert.NAME, senderPersonal);
|
||||
}
|
||||
|
||||
activity.startActivity(contactIntent);
|
||||
mContext.startActivity(contactIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.fsck.k9.helper;
|
|||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
|
@ -69,7 +68,7 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts
|
|||
}
|
||||
|
||||
@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);
|
||||
|
||||
|
@ -87,7 +86,7 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts
|
|||
contactIntent.putExtra(Intents.Insert.NAME, senderPersonal);
|
||||
}
|
||||
|
||||
activity.startActivity(contactIntent);
|
||||
mContext.startActivity(contactIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue