@Override public void onCreate(Bundle icicle) { mBase = K9ActivityCommon.newInstance(this); super.onCreate(icicle); setContentView(R.layout.settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { toolbar.setTitle(R.string.preferences_title); setSupportActionBar(toolbar); } ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } final Intent intent = getIntent(); final String action = intent.getAction(); if (action == null) { GlobalPreferences fragment = GlobalPreferences.newInstance(this); loadPreference(fragment, false); } else if (EDIT_ACCOUNT_ACTION.equals(action)) { final String accountUuid = intent.getStringExtra(ACCOUNT_EXTRA); Account account = Preferences.getPreferences(this).getAccount(accountUuid); AccountPreferences fragment = AccountPreferences.newInstance(account); loadPreference(fragment, false); } else if (EDIT_FOLDER_ACTION.equals(action)) { final String accountUuid = intent.getStringExtra(ACCOUNT_EXTRA); Account account = Preferences.getPreferences(this).getAccount(accountUuid); final String folderName = intent.getStringExtra(FOLDER_EXTRA); // onFolderClick(account); } }
@Override public void onAccountClick(Account account) { AccountPreferences fragment = AccountPreferences.newInstance(account); loadPreference(fragment, true); }