From: David A. Velasco Date: Thu, 2 Jul 2015 11:03:48 +0000 (+0200) Subject: Fixed title in action bar when user clicks on upload notification in progress / failed X-Git-Tag: oc-android-1.7.2~1^2~2 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/0f0e210d6979f45a1f9609371bb39cbb5faee6fe?ds=inline;hp=--cc Fixed title in action bar when user clicks on upload notification in progress / failed --- 0f0e210d6979f45a1f9609371bb39cbb5faee6fe diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 19960e3b..9a952e41 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -405,19 +405,14 @@ public class FileActivity extends ActionBarActivity /// choose the appropiate title if (chosenFile == null) { - // mFile determines the title - inRoot = (mFile == null || mFile.getParentId() == 0); - if (!inRoot) { - title = mFile.getFileName(); - } - - } else if (chosenFile.getParentId() != 0){ - // chosenFile determines the title, instead of mFile + chosenFile = mFile; // if no file is passed, current file decides + } + inRoot = ( + chosenFile == null || + (chosenFile.isFolder() && chosenFile.getParentId() == FileDataStorageManager.ROOT_PARENT_ID) + ); + if (!inRoot) { title = chosenFile.getFileName(); - inRoot = false; - - } else{ - inRoot = true; } /// set the chosen title