X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/cb175f29949dbac17a3870a71ecff60df5c9bdc4..65b2da31cc12e63518b1f9023d6286b7f04657b7:/src/com/owncloud/android/ui/activity/Preferences.java diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 3b98061e..5585024d 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -1,6 +1,10 @@ -/* ownCloud Android client application +/** + * ownCloud Android client application + * + * @author Bartek Przybylski + * @author David A. Velasco * Copyright (C) 2011 Bartek Przybylski - * Copyright (C) 2012-2015 ownCloud Inc. + * Copyright (C) 2015 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -70,9 +74,6 @@ import java.io.File; /** * An Activity that allows the user to change the application's settings. - * - * @author Bartek Przybylski - * @author David A. Velasco */ public class Preferences extends SherlockPreferenceActivity implements AccountManagerCallback, ComponentsGetter { @@ -116,6 +117,14 @@ public class Preferences extends SherlockPreferenceActivity actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(R.string.actionbar_settings); + // For adding content description tag to a title field in the action bar + int actionBarTitleId = getResources().getIdentifier("action_bar_title", "id", "android"); + View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId); + if (actionBarTitleView != null) { // it's null in Android 2.x + getWindow().getDecorView().findViewById(actionBarTitleId). + setContentDescription(getString(R.string.actionbar_settings)); + } + // Load the accounts category for adding the list of accounts mAccountsPrefCategory = (PreferenceCategory) findPreference("accounts_category"); @@ -444,8 +453,12 @@ public class Preferences extends SherlockPreferenceActivity Account account = new Account(mAccountName, MainApp.getAccountType()); if (!AccountUtils.exists(account, MainApp.getAppContext())) { // Cancel tranfers - mUploaderBinder.cancel(account); - mDownloaderBinder.cancel(account); + if (mUploaderBinder != null) { + mUploaderBinder.cancel(account); + } + if (mDownloaderBinder != null) { + mDownloaderBinder.cancel(account); + } } Account a = AccountUtils.getCurrentOwnCloudAccount(this);