Merge pull request #234 from LukeOwncloud/develop
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index 6485524..e0d48a3 100644 (file)
@@ -161,6 +161,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     private View mOkButton;\r
     \r
     private String mAuthToken;\r
+    \r
+    private boolean mResumed; // Control if activity is resumed\r
 \r
 \r
     /**\r
@@ -215,6 +217,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         }\r
 \r
         if (savedInstanceState == null) {\r
+            mResumed = false;\r
             /// connection state and info\r
             mAuthMessageVisibility = View.GONE;\r
             mServerStatusText = mServerStatusIcon = 0;\r
@@ -243,6 +246,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             }\r
             \r
         } else {\r
+            mResumed = true;\r
             /// connection state and info\r
             mAuthMessageVisibility = savedInstanceState.getInt(KEY_AUTH_MESSAGE_VISIBILITY);\r
             mAuthMessageText = savedInstanceState.getString(KEY_AUTH_MESSAGE_TEXT);\r
@@ -327,16 +331,20 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             }\r
 \r
             @Override\r
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {}\r
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {\r
+            }\r
 \r
             @Override\r
             public void onTextChanged(CharSequence s, int start, int before, int count) {\r
+                if (!mResumed) {\r
                     mAuthStatusIcon = 0;\r
                     mAuthStatusText = 0;\r
-                    showAuthStatus();\r
+                    showAuthStatus();                    \r
+                }\r
+                mResumed = false;\r
             }\r
-\r
         });\r
+        \r
         mPasswordInput.setOnFocusChangeListener(this);\r
         mPasswordInput.setImeOptions(EditorInfo.IME_ACTION_DONE);\r
         mPasswordInput.setOnEditorActionListener(this);