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
This commit is contained in:
Todd Kennedy 2011-04-01 11:57:52 -07:00
parent ad7dc464db
commit ef844d86f1
3 changed files with 3 additions and 6 deletions

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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();
}