Fix: app crash when trying to edit the url. Fix a problem from android support librar...
authormasensio <masensio@solidgear.es>
Tue, 2 Jun 2015 12:01:42 +0000 (14:01 +0200)
committermasensio <masensio@solidgear.es>
Tue, 2 Jun 2015 12:01:42 +0000 (14:01 +0200)
src/com/owncloud/android/authentication/AuthenticatorActivity.java

index 3ab7690..10993e1 100644 (file)
@@ -206,8 +206,17 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     protected void onCreate(Bundle savedInstanceState) {\r
         //Log_OC.wtf(TAG,  "onCreate init");\r
         super.onCreate(savedInstanceState);\r
     protected void onCreate(Bundle savedInstanceState) {\r
         //Log_OC.wtf(TAG,  "onCreate init");\r
         super.onCreate(savedInstanceState);\r
-        getWindow().requestFeature(Window.FEATURE_NO_TITLE);\r
 \r
 \r
+        // Workaround, for fixing a problem with Android Library Suppor v7 19\r
+        //getWindow().requestFeature(Window.FEATURE_NO_TITLE);\r
+        if (getSupportActionBar() != null) {\r
+            getSupportActionBar().hide();\r
+\r
+            getSupportActionBar().setDisplayHomeAsUpEnabled(false);\r
+            getSupportActionBar().setDisplayShowHomeEnabled(false);\r
+            getSupportActionBar().setDisplayShowTitleEnabled(false);\r
+        }\r
+        \r
         mIsFirstAuthAttempt = true;\r
 \r
         // bind to Operations Service\r
         mIsFirstAuthAttempt = true;\r
 \r
         // bind to Operations Service\r
@@ -787,7 +796,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             Intent getServerInfoIntent = new Intent();\r
             getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
             getServerInfoIntent.putExtra(\r
             Intent getServerInfoIntent = new Intent();\r
             getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
             getServerInfoIntent.putExtra(\r
-                OperationsService.EXTRA_SERVER_URL, \r
+                OperationsService.EXTRA_SERVER_URL,\r
                 normalizeUrlSuffix(uri)\r
             );\r
             if (mOperationsServiceBinder != null) {\r
                 normalizeUrlSuffix(uri)\r
             );\r
             if (mOperationsServiceBinder != null) {\r
@@ -1106,7 +1115,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                     url = "http://" + url;\r
                 }\r
             }\r
                     url = "http://" + url;\r
                 }\r
             }\r
-        \r
+\r
             url = normalizeUrlSuffix(url);\r
         }\r
         return (url != null ? url : "");\r
             url = normalizeUrlSuffix(url);\r
         }\r
         return (url != null ? url : "");\r
@@ -1425,7 +1434,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);\r
 \r
         if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
         response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);\r
 \r
         if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
-                equals(mAuthTokenType)) { \r
+                equals(mAuthTokenType)) {\r
             response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
             // the next line is necessary, notifications are calling directly to the \r
             // AuthenticatorActivity to update, without AccountManager intervention\r
             response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
             // the next line is necessary, notifications are calling directly to the \r
             // AuthenticatorActivity to update, without AccountManager intervention\r
@@ -1898,5 +1907,4 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         mIsFirstAuthAttempt = true;\r
     }\r
 \r
         mIsFirstAuthAttempt = true;\r
     }\r
 \r
-\r
 }\r
 }\r