From 052695af838bafc3bca90e82d828b2898fe59024 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 10 Jan 2011 17:47:23 +0000 Subject: [PATCH] Simplify Contacts API --- src/com/fsck/k9/helper/Contacts.java | 3 +-- src/com/fsck/k9/helper/ContactsSdk3_4.java | 4 ++-- src/com/fsck/k9/helper/ContactsSdk5.java | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/com/fsck/k9/helper/Contacts.java b/src/com/fsck/k9/helper/Contacts.java index 6ce18caba..ec52d1824 100644 --- a/src/com/fsck/k9/helper/Contacts.java +++ b/src/com/fsck/k9/helper/Contacts.java @@ -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. diff --git a/src/com/fsck/k9/helper/ContactsSdk3_4.java b/src/com/fsck/k9/helper/ContactsSdk3_4.java index a381c8dc6..7c602c003 100644 --- a/src/com/fsck/k9/helper/ContactsSdk3_4.java +++ b/src/com/fsck/k9/helper/ContactsSdk3_4.java @@ -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 diff --git a/src/com/fsck/k9/helper/ContactsSdk5.java b/src/com/fsck/k9/helper/ContactsSdk5.java index 57afb8d82..afd8d111c 100644 --- a/src/com/fsck/k9/helper/ContactsSdk5.java +++ b/src/com/fsck/k9/helper/ContactsSdk5.java @@ -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