- AccountManager am = (AccountManager) getSystemService(ACCOUNT_SERVICE);\r
- WebdavClient wdc = new WebdavClient(mAccount, getApplicationContext());\r
- String username = mAccount.name.split("@")[0];\r
- String password = null;\r
- try {\r
- password = am.blockingGetAuthToken(mAccount,\r
- AccountAuthenticator.AUTH_TOKEN_TYPE, true);\r
- } catch (Exception e) {\r
- Log.e(TAG, "Access to account credentials failed", e);\r
- sendFinalBroadcast(downloadResult, null);\r
- return;\r
- }\r
- wdc.setCredentials(username, password);\r
- wdc.allowSelfsignedCertificates();\r