Merge branch 'fragments-ui' of ssh://git@gitorious.org/owncloud/android.git into...
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / ui / activity / LandingActivity.java
index d4301d1..a12a31c 100644 (file)
@@ -17,6 +17,8 @@
  */\r
 package eu.alefzero.owncloud.ui.activity;\r
 \r
+import com.actionbarsherlock.app.SherlockFragmentActivity;\r
+\r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
 import android.app.AlertDialog;\r
@@ -25,7 +27,6 @@ import android.content.DialogInterface;
 import android.content.DialogInterface.OnClickListener;\r
 import android.content.Intent;\r
 import android.os.Bundle;\r
-import android.support.v4.app.FragmentActivity;\r
 import android.view.View;\r
 import android.widget.AdapterView;\r
 import android.widget.AdapterView.OnItemClickListener;\r
@@ -40,7 +41,7 @@ import eu.alefzero.owncloud.ui.adapter.LandingScreenAdapter;
  * @author Lennart Rosam\r
  * \r
  */\r
-public class LandingActivity extends FragmentActivity implements OnClickListener, OnItemClickListener {\r
+public class LandingActivity extends SherlockFragmentActivity implements OnClickListener, OnItemClickListener {\r
 \r
        public static final int DIALOG_SETUP_ACCOUNT = 1;\r
        \r
@@ -62,6 +63,24 @@ public class LandingActivity extends FragmentActivity implements OnClickListener
                }\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