From ef844d86f1e51d2b5b0ffcc59dcd605d6acc6ef5 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Fri, 1 Apr 2011 11:57:52 -0700 Subject: [PATCH] Update method parameters Only pass along the things we need. For the message dialog, we were passing in an Activity that was not needed. In the ActivityHelper, we were passing in an Activity when all we needed was a Context. Change-Id: I9a93ae07ff2bbdce9466c7e991410c87fb610673 --- src/com/android/email/activity/MessageListFragment.java | 3 +-- src/com/android/email/activity/MessageListXL.java | 2 +- src/com/android/email/activity/MoveMessageToDialog.java | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/com/android/email/activity/MessageListFragment.java b/src/com/android/email/activity/MessageListFragment.java index 867652c5d..6a78ff3a0 100644 --- a/src/com/android/email/activity/MessageListFragment.java +++ b/src/com/android/email/activity/MessageListFragment.java @@ -703,8 +703,7 @@ public class MessageListFragment extends ListFragment public void onMultiMove() { long[] messageIds = Utility.toPrimitiveLongArray(mListAdapter.getSelectedSet()); - MoveMessageToDialog dialog = MoveMessageToDialog.newInstance(getActivity(), messageIds, - this); + MoveMessageToDialog dialog = MoveMessageToDialog.newInstance(messageIds, this); dialog.show(getFragmentManager(), "dialog"); } diff --git a/src/com/android/email/activity/MessageListXL.java b/src/com/android/email/activity/MessageListXL.java index 8c9702af5..9f61f6cd1 100644 --- a/src/com/android/email/activity/MessageListXL.java +++ b/src/com/android/email/activity/MessageListXL.java @@ -320,7 +320,7 @@ public class MessageListXL extends Activity implements private void onMoveMessage() { long messageId = mFragmentManager.getMessageId(); - MoveMessageToDialog dialog = MoveMessageToDialog.newInstance(this, new long[] {messageId}, + MoveMessageToDialog dialog = MoveMessageToDialog.newInstance(new long[] {messageId}, null); dialog.show(getFragmentManager(), "dialog"); } diff --git a/src/com/android/email/activity/MoveMessageToDialog.java b/src/com/android/email/activity/MoveMessageToDialog.java index f75e278ac..33f0e735f 100644 --- a/src/com/android/email/activity/MoveMessageToDialog.java +++ b/src/com/android/email/activity/MoveMessageToDialog.java @@ -66,14 +66,12 @@ public class MoveMessageToDialog extends DialogFragment implements DialogInterfa /** * Create and return a new instance. * - * @param parent owner activity. * @param messageIds IDs of the messages to be moved. * @param callbackFragment Fragment that gets a callback. The fragment must implement * {@link Callback}. If null is passed, then the owner activity is used instead, in which case * it must implement {@link Callback} instead. */ - public static MoveMessageToDialog newInstance(Activity parent, - long[] messageIds, Fragment callbackFragment) { + public static MoveMessageToDialog newInstance(long[] messageIds, Fragment callbackFragment) { if (messageIds.length == 0) { throw new InvalidParameterException(); }