From 5f4752486479d738e5187bdd0493b2b0fbf738f8 Mon Sep 17 00:00:00 2001 From: masensio Date: Tue, 2 Jun 2015 15:26:42 +0200 Subject: [PATCH] fix, in a tablet, the title is not correct when menu is shown and rotating --- src/com/owncloud/android/ui/activity/FileActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 382019f8..13bad2ed 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -393,13 +393,18 @@ public class FileActivity extends ActionBarActivity } protected void updateActionBarTitleAndHomeButton(){ - if (mFile.getParentId() == 0) { + if (mFile.getParentId() == 0 || + (!mFile.isFolder() && mFile.getParentId() == 1)) { getSupportActionBar().setTitle(getString( R.string.default_display_name_for_root_folder)); mDrawerToggle.setDrawerIndicatorEnabled(true); - } else { + } else if (mFile.isFolder()) { getSupportActionBar().setTitle(mFile.getFileName().toString()); mDrawerToggle.setDrawerIndicatorEnabled(false); + } else { + getSupportActionBar().setTitle(getStorageManager().getFileById(mFile.getParentId()) + .getFileName().toString()); + mDrawerToggle.setDrawerIndicatorEnabled(false); } } /** -- 2.11.0