diff --git a/src/com/fsck/k9/activity/K9ActivityCommon.java b/src/com/fsck/k9/activity/K9ActivityCommon.java index 2dd65e9b7..251ef02b7 100644 --- a/src/com/fsck/k9/activity/K9ActivityCommon.java +++ b/src/com/fsck/k9/activity/K9ActivityCommon.java @@ -8,6 +8,7 @@ import com.fsck.k9.activity.misc.SwipeGestureDetector.OnSwipeGestureListener; import com.fsck.k9.helper.StringUtils; import android.app.Activity; +import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; @@ -36,7 +37,7 @@ public class K9ActivityCommon { return new K9ActivityCommon(activity); } - public static void setLanguage(Activity activity, String language) { + public static void setLanguage(Context context, String language) { Locale locale; if (StringUtils.isNullOrEmpty(language)) { locale = Locale.getDefault(); @@ -49,7 +50,7 @@ public class K9ActivityCommon { Configuration config = new Configuration(); config.locale = locale; - Resources resources = activity.getResources(); + Resources resources = context.getResources(); resources.updateConfiguration(config, resources.getDisplayMetrics()); } diff --git a/tests/src/com/fsck/k9/TranslationTest.java b/tests/src/com/fsck/k9/TranslationTest.java index 2cd39ed26..2bcf51d4f 100644 --- a/tests/src/com/fsck/k9/TranslationTest.java +++ b/tests/src/com/fsck/k9/TranslationTest.java @@ -1,6 +1,6 @@ package com.fsck.k9; -import com.fsck.k9.activity.K9Activity; +import com.fsck.k9.activity.K9ActivityCommon; import com.fsck.k9.helper.DateFormatter; import android.content.Context; @@ -29,7 +29,7 @@ public class TranslationTest extends AndroidTestCase { String[] languages = res.getStringArray(R.array.supported_languages); for (String lang : languages) { - K9Activity.setLanguage(mContext, lang); + K9ActivityCommon.setLanguage(mContext, lang); action.runWithLanguage(mContext, lang); } diff --git a/tests/src/com/fsck/k9/mail/internet/ViewablesTest.java b/tests/src/com/fsck/k9/mail/internet/ViewablesTest.java index e25ceca1d..4aae4531f 100644 --- a/tests/src/com/fsck/k9/mail/internet/ViewablesTest.java +++ b/tests/src/com/fsck/k9/mail/internet/ViewablesTest.java @@ -6,6 +6,7 @@ import java.util.TimeZone; import android.test.AndroidTestCase; import com.fsck.k9.activity.K9Activity; +import com.fsck.k9.activity.K9ActivityCommon; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.Message.RecipientType; @@ -109,7 +110,7 @@ public class ViewablesTest extends AndroidTestCase { } public void testTextPlusRfc822Message() throws MessagingException { - K9Activity.setLanguage(getContext(), "en"); + K9ActivityCommon.setLanguage(getContext(), "en"); Locale.setDefault(Locale.US); TimeZone.setDefault(TimeZone.getTimeZone("GMT+01:00"));