1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 09:38:52 -05:00

minor refactoring to cut down on repeated method calls

This commit is contained in:
Jesse Vincent 2009-12-17 05:24:48 +00:00
parent ce44165634
commit c8bd377e76

View File

@ -439,14 +439,16 @@ public class MessageList
{
super.onResume();
sortType = MessagingController.getInstance(getApplication()).getSortType();
sortAscending = MessagingController.getInstance(getApplication()).isSortAscending(sortType);
sortDateAscending = MessagingController.getInstance(getApplication()).isSortAscending(SORT_TYPE.SORT_DATE);
MessagingController controller = MessagingController.getInstance(getApplication());
MessagingController.getInstance(getApplication()).addListener(mAdapter.mListener);
sortType = controller.getSortType();
sortAscending = controller.isSortAscending(sortType);
sortDateAscending = controller.isSortAscending(SORT_TYPE.SORT_DATE);
controller.addListener(mAdapter.mListener);
mAdapter.messages.clear();
mAdapter.notifyDataSetChanged();
MessagingController.getInstance(getApplication()).listLocalMessages(mAccount, mFolderName, mAdapter.mListener);
controller.listLocalMessages(mAccount, mFolderName, mAdapter.mListener);
NotificationManager notifMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notifMgr.cancel(mAccount.getAccountNumber());