From cf2ba0bc0724af1a4815dde14c1d8597297fee3f Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Fri, 1 Mar 2013 16:05:19 +0100 Subject: [PATCH] Fixed infinity loop in media previews when the icon in the action bar (UP button) is pressed --- .../owncloud/android/ui/activity/FileDetailActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/owncloud/android/ui/activity/FileDetailActivity.java b/src/com/owncloud/android/ui/activity/FileDetailActivity.java index 2ab8bcc950..46632d6581 100644 --- a/src/com/owncloud/android/ui/activity/FileDetailActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDetailActivity.java @@ -258,7 +258,11 @@ public class FileDetailActivity extends SherlockFragmentActivity implements File private void backToDisplayActivity() { Intent intent = new Intent(this, FileDisplayActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - intent.putExtra(FileDetailFragment.EXTRA_FILE, mFile); + OCFile targetFile = null; + if (mFile != null) { + targetFile = mStorageManager.getFileById(mFile.getParentId()); + } + intent.putExtra(FileDetailFragment.EXTRA_FILE, targetFile); intent.putExtra(FileDetailFragment.EXTRA_ACCOUNT, mAccount); startActivity(intent); finish();