我正在使用AbstractAccountAuthenticator,我想为我的应用单独帐户.因此,当用户选择为此应用添加新帐户时,我想提示消息.我看到其他应用程序使用Toast来显示消息,但由于某些原因,我没有显示.
我显示如下消息:
public Bundle addAccount() {
if (accounts.size() > 0) {
Toast.makeText(context, R.string.MSG_ONLY_ONE_ACCOUNT_IS_SUPPORTED, Toast.LENGTH_LONG).show();
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?我正在检查AbstractAccountAuthenticator的addAccount()方法中的帐号.