Android How to add/configure Exchange setting programmatically?

前端 未结 2 337
清酒与你
清酒与你 2021-01-20 10:36

Is it me or I can\'t find any example of how to add/configure Microsoft Exchange programatically?

It seems like

AccountManager ::

addAccou         


        
2条回答
  •  终归单人心
    2021-01-20 11:33

    Seems like it can't be done by applications.

    you'll get the following exception:

    ERROR/AndroidRuntime(442): Caused by: java.lang.SecurityException: caller uid xxxxx is different than the authenticator's uid

    you'll get this exception because the account manager verifies that the application that wrote the exchange authenticator (Google) is the same one that is creating the account. here's a post that explains AccountManager's logic in that case.

提交回复
热议问题