Emergency fix: accesibility additions break Android 2.x
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 25 Mar 2015 10:28:02 +0000 (11:28 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 25 Mar 2015 10:28:02 +0000 (11:28 +0100)
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index e921d73..052250d 100644 (file)
@@ -1393,7 +1393,10 @@ OnSslUntrustedCertListener, OnEnforceableRefreshListener {
             actionBar.setDisplayShowTitleEnabled(!noRoot); 
             if (!noRoot) {
                 actionBar.setTitle(getString(R.string.default_display_name_for_root_folder));
-                getWindow().getDecorView().findViewById(actionBarTitleId).setContentDescription(getString(R.string.default_display_name_for_root_folder));
+                View actionBarView = getWindow().getDecorView().findViewById(actionBarTitleId);
+                if (actionBarView != null) {    // it's null in Android 2.x (at least)
+                    actionBarView.setContentDescription(getString(R.string.default_display_name_for_root_folder));
+                }
             }
             actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD : ActionBar.NAVIGATION_MODE_LIST);
             actionBar.setListNavigationCallbacks(mDirectories, this);   // assuming mDirectories is updated