Fixed preview of images in Android 2.x ; fixed synchronization progress indicator...
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / AccountUtils.java
index 090dec3..d088d2c 100644 (file)
@@ -68,6 +68,21 @@ public class AccountUtils {
         return defaultAccount;\r
     }\r
 \r
+    \r
+\r
+    /**\r
+     * Checks, whether or not there are any ownCloud accounts setup.\r
+     * \r
+     * @return true, if there is at least one account.\r
+     */\r
+    public static boolean accountsAreSetup(Context context) {\r
+        AccountManager accMan = AccountManager.get(context);\r
+        Account[] accounts = accMan\r
+                .getAccountsByType(AccountAuthenticator.ACCOUNT_TYPE);\r
+        return accounts.length > 0;\r
+    }\r
+    \r
+    \r
     public static void setCurrentOwnCloudAccount(Context context, String name) {\r
         SharedPreferences.Editor appPrefs = PreferenceManager\r
                 .getDefaultSharedPreferences(context).edit();\r