- mShowHiddenAccounts = menu.findItem(R.id.menu_acc_summary_only_starred);
- if (mShowHiddenAccounts == null) throw new AssertionError();
+ mShowOnlyStarred = menu.findItem(R.id.menu_acc_summary_only_starred);
+ if (mShowOnlyStarred == null) throw new AssertionError();
+ MenuItem mCancelSelection = menu.findItem(R.id.menu_acc_summary_cancel_selection);
+ if (mCancelSelection == null) throw new AssertionError();
+ MenuItem mConfirmSelection = menu.findItem(R.id.menu_acc_summary_confirm_selection);
+ if (mConfirmSelection == null) throw new AssertionError();
+
+ Data.optShowOnlyStarred.addObserver((o, arg) -> {
+ boolean newValue = Data.optShowOnlyStarred.get();
+ Log.d("pref", String.format("pref change came (%s)", newValue ? "true" : "false"));
+ mShowOnlyStarred.setChecked(newValue);
+ update_account_table();
+ });
+
+ mShowOnlyStarred.setChecked(Data.optShowOnlyStarred.get());
+
+ Log.d("menu", "Accounts: onCreateOptionsMenu called");