From d4c14f8b29baa8a9d61fee3eeac46499d88a0fe5 Mon Sep 17 00:00:00 2001 From: masensio Date: Tue, 2 Jun 2015 14:01:42 +0200 Subject: [PATCH] Fix: app crash when trying to edit the url. Fix a problem from android support library v7 (19) --- .../authentication/AuthenticatorActivity.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index 3ab76901d2..10993e1c40 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -206,8 +206,17 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity protected void onCreate(Bundle savedInstanceState) { //Log_OC.wtf(TAG, "onCreate init"); super.onCreate(savedInstanceState); - getWindow().requestFeature(Window.FEATURE_NO_TITLE); + // Workaround, for fixing a problem with Android Library Suppor v7 19 + //getWindow().requestFeature(Window.FEATURE_NO_TITLE); + if (getSupportActionBar() != null) { + getSupportActionBar().hide(); + + getSupportActionBar().setDisplayHomeAsUpEnabled(false); + getSupportActionBar().setDisplayShowHomeEnabled(false); + getSupportActionBar().setDisplayShowTitleEnabled(false); + } + mIsFirstAuthAttempt = true; // bind to Operations Service @@ -787,7 +796,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity Intent getServerInfoIntent = new Intent(); getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO); getServerInfoIntent.putExtra( - OperationsService.EXTRA_SERVER_URL, + OperationsService.EXTRA_SERVER_URL, normalizeUrlSuffix(uri) ); if (mOperationsServiceBinder != null) { @@ -1106,7 +1115,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity url = "http://" + url; } } - + url = normalizeUrlSuffix(url); } return (url != null ? url : ""); @@ -1425,7 +1434,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type); if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()). - equals(mAuthTokenType)) { + equals(mAuthTokenType)) { response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken); // the next line is necessary, notifications are calling directly to the // AuthenticatorActivity to update, without AccountManager intervention @@ -1898,5 +1907,4 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity mIsFirstAuthAttempt = true; } - }