开发者

How to trigger Account Manager to add new account from application

I am trying to extend the SampleSync application. After I install the app, I can go to s开发者_开发百科ettings -> accounts & sync -> add account to add an account. However, if I want to check from my Application code and want to trigger AccountManager to add a new account directly, what should be the best way?


Ok, finally I got it working,

You can actually activate the AccountManager to add an account:

final AccountManager accountMgr = AccountManager.get(Main.this);
accountMgr.addAccount(Constants.ACCOUNT_TYPE, Constants.AUTHTOKEN_TYPE, null, null, Main.this, null, null);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜