1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 17:18:50 -05:00

Retain unread count in Accounts activity during configuration changes

This commit is contained in:
cketti 2012-12-07 13:35:49 +01:00
parent 8100e00523
commit 144884080d

View File

@ -326,6 +326,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
}; };
private static String ACCOUNT_STATS = "accountStats"; private static String ACCOUNT_STATS = "accountStats";
private static String STATE_UNREAD_COUNT = "unreadCount";
private static String SELECTED_CONTEXT_ACCOUNT = "selectedContextAccount"; private static String SELECTED_CONTEXT_ACCOUNT = "selectedContextAccount";
public static final String EXTRA_STARTUP = "startup"; public static final String EXTRA_STARTUP = "startup";
@ -441,6 +442,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
if (oldStats != null) { if (oldStats != null) {
accountStats.putAll(oldStats); accountStats.putAll(oldStats);
} }
mUnreadMessageCount = icicle.getInt(STATE_UNREAD_COUNT);
} }
} }
@ -450,6 +452,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
if (mSelectedContextAccount != null) { if (mSelectedContextAccount != null) {
outState.putString(SELECTED_CONTEXT_ACCOUNT, mSelectedContextAccount.getUuid()); outState.putString(SELECTED_CONTEXT_ACCOUNT, mSelectedContextAccount.getUuid());
} }
outState.putSerializable(STATE_UNREAD_COUNT, mUnreadMessageCount);
outState.putSerializable(ACCOUNT_STATS, accountStats); outState.putSerializable(ACCOUNT_STATS, accountStats);
} }