1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Simplify Handler code to restore message list state

This commit is contained in:
cketti 2013-02-05 19:56:12 +01:00
parent 7f39b3c6d8
commit 4b920e19b0

View File

@ -484,11 +484,10 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
}
public void restoreListPosition() {
if (!hasMessages(ACTION_RESTORE_LIST_POSITION)) {
android.os.Message msg = android.os.Message.obtain(this,
ACTION_RESTORE_LIST_POSITION);
sendMessage(msg);
}
android.os.Message msg = android.os.Message.obtain(this, ACTION_RESTORE_LIST_POSITION,
mSavedListState);
mSavedListState = null;
sendMessage(msg);
}
public void openMessage(MessageReference messageReference) {
@ -534,7 +533,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
break;
}
case ACTION_RESTORE_LIST_POSITION: {
mListView.onRestoreInstanceState(mSavedListState);
mListView.onRestoreInstanceState((Parcelable) msg.obj);
mSavedListState = null;
break;
}