Programmatically starting the 'Add Account' activity in Android 2.2

前端 未结 6 1367
耶瑟儿~
耶瑟儿~ 2020-12-16 19:47

I\'ve been experimenting with the Android SDK over the past few days, in readiness to write an App for the store, however I\'ve run across a bit of a problem.

The Ap

6条回答
  •  暖寄归人
    2020-12-16 20:00

    Try the following:

    public static void addGoogleAccount(final Activity activity) {
        final AccountManager accountMgr = AccountManager.get(activity);
        accountMgr.addAccount("com.google", "my_auth_token", null, null, activity, null, null);
    }
    

提交回复
热议问题