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:
parent
7f39b3c6d8
commit
4b920e19b0
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user