1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Simplify Contacts API

This commit is contained in:
Jesse Vincent 2011-01-10 17:47:23 +00:00
parent 0ca6adfbf8
commit 052695af83
3 changed files with 5 additions and 7 deletions

View File

@ -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.

View File

@ -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

View File

@ -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