}\r
 \r
        }\r
+       \r
+       @Override\r
+       protected void onRestart() {\r
+               super.onRestart();\r
+               // Check, if there are ownCloud accounts\r
+               if(!accountsAreSetup()){\r
+                       showDialog(DIALOG_SETUP_ACCOUNT);\r
+               }\r
+       }\r
+\r
+       @Override\r
+       protected void onRestoreInstanceState(Bundle savedInstanceState) {\r
+               super.onRestoreInstanceState(savedInstanceState);\r
+               // Check, if there are ownCloud accounts\r
+               if(!accountsAreSetup()){\r
+                       showDialog(DIALOG_SETUP_ACCOUNT);\r
+               }\r
+       }\r
 \r
        @Override\r
        protected Dialog onCreateDialog(int id) {\r