diff --git a/src/com/android/email/mail/Sender.java b/src/com/android/email/mail/Sender.java index 65852b412..836095243 100644 --- a/src/com/android/email/mail/Sender.java +++ b/src/com/android/email/mail/Sender.java @@ -49,11 +49,11 @@ public abstract class Sender { Class c = Class.forName(className); // and invoke "newInstance" class method and instantiate sender object. java.lang.reflect.Method m = - c.getMethod("newInstance", String.class, Context.class); - o = m.invoke(null, uri, context); + c.getMethod("newInstance", Context.class, String.class); + o = m.invoke(null, context, uri); } catch (Exception e) { Log.d(Email.LOG_TAG, String.format( - "exception %s invoking %s.newInstance.(String, Context) method for %s", + "exception %s invoking %s.newInstance.(Context, String) method for %s", e.toString(), className, uri)); throw new MessagingException("can not instantiate Sender object for " + uri); } diff --git a/src/com/android/email/mail/exchange/ExchangeSenderExample.java b/src/com/android/email/mail/exchange/ExchangeSenderExample.java index 3840e21e8..a14b6e31a 100644 --- a/src/com/android/email/mail/exchange/ExchangeSenderExample.java +++ b/src/com/android/email/mail/exchange/ExchangeSenderExample.java @@ -41,11 +41,12 @@ public class ExchangeSenderExample extends Sender { /** * Factory method. */ - public static Sender newInstance(String uri, Context context) throws MessagingException { - return new ExchangeSenderExample(uri, context); + @Override + public static Sender newInstance(Context context, String uri) throws MessagingException { + return new ExchangeSenderExample(context, uri); } - private ExchangeSenderExample(String _uri, Context context) throws MessagingException { + private ExchangeSenderExample(Context context, String _uri) throws MessagingException { mContext = context; URI uri = null;