how can i connect to some existing account?

78 Views Asked by At

I am trying to add my google account to the: Settings -> Accounts on my phone.

The account is already created and working but I am not able to connect programmatically.

I have already tried following:

    AccountManager accountManager = AccountManager.get(this);
    Account account = new Account("[email protected]","com.google");
    boolean success = accountManager.addAccountExplicitly(account,"password",null);

but the app keeps crashing, i believe due to permission problems. tried to find the right permissions but couldn't manage. If someone can show me the full way to do it, it would be great.

0

There are 0 best solutions below