Add method for launching MessageList with an account

This commit is contained in:
lwerneke 2020-08-13 15:17:40 +02:00 committed by GitHub
parent 72b1c6ef96
commit fa5b2b77f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -172,6 +172,14 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
context.startActivity(intent);
}
public static void launch(Context context, Account account) {
long folderId = DI.get(DefaultFolderProvider.class).getDefaultFolder(account);
LocalSearch search = new LocalSearch();
search.addAllowedFolder(folderId);
search.addAccountUuid(account.getUuid());
actionDisplaySearch(context, search, false, false);
}
private enum DisplayMode {
MESSAGE_LIST,

View file

@ -90,7 +90,7 @@ public class AccountSetupNames extends K9Activity implements OnClickListener {
}
mAccount.setName(mName.getText().toString());
Preferences.getPreferences(getApplicationContext()).saveAccount(mAccount);
MessageList.launch(this);
MessageList.launch(this, mAccount);
finish();
}