}\r
\r
\r
+ public static boolean exists(Account account, Context context) {\r
+ Account[] ocAccounts = AccountManager.get(context).getAccountsByType(\r
+ AccountAuthenticator.ACCOUNT_TYPE);\r
+\r
+ if (account != null && account.name != null) {\r
+ for (Account ac : ocAccounts) {\r
+ if (ac.name.equals(account.name)) {\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+ \r
\r
/**\r
* Checks, whether or not there are any ownCloud accounts setup.\r