X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5fc7cd13e7e561ef528e12d2fa088b58e35e00d0..1192e036cee4d974576b005c833e9db64c6093a0:/src/com/owncloud/android/ui/activity/FileDisplayActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index b3202976..22ef63b4 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -187,11 +187,11 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(mDirectories, this); setSupportProgressBarIndeterminateVisibility(false); // always AFTER setContentView(...) ; to workaround bug in its implementation - + Log.d(getClass().toString(), "onCreate() end"); } - + /** * Launches the account creation activity. To use when no ownCloud account is available */ @@ -222,7 +222,9 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements mCurrentDir = mStorageManager.getFileByPath(mCurrentDir.getRemotePath()); // mCurrentDir == null if it is not in the current account } if (mCurrentFile != null) { - mCurrentFile = mStorageManager.getFileByPath(mCurrentFile.getRemotePath()); // mCurrentFile == null if it is not in the current account + if (mCurrentFile.fileExists()) { + mCurrentFile = mStorageManager.getFileByPath(mCurrentFile.getRemotePath()); // mCurrentFile == null if it is not in the current account + } // else : keep mCurrentFile with the received value; this is currently the case of an upload in progress, when the user presses the status notification in a landscape tablet } /// Default to root if mCurrentDir was not found @@ -442,9 +444,11 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements outState.putParcelable(FileDetailFragment.EXTRA_FILE, mCurrentDir); if (mDualPane) { FileDetailFragment fragment = (FileDetailFragment) getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG); - OCFile file = fragment.getDisplayedFile(); - if (file != null) { - outState.putParcelable(FileDetailFragment.EXTRA_FILE, file); + if (fragment != null) { + OCFile file = fragment.getDisplayedFile(); + if (file != null) { + outState.putParcelable(FileDetailFragment.EXTRA_FILE, file); + } } } Log.d(getClass().toString(), "onSaveInstanceState() end"); @@ -481,7 +485,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements registerReceiver(mDownloadFinishReceiver, downloadIntentFilter); // List current directory - mFileList.listDirectory(mCurrentDir); // we should find the way to avoid the need of this + mFileList.listDirectory(mCurrentDir); // TODO we should find the way to avoid the need of this (maybe it's not necessary yet; to check) } else { @@ -548,7 +552,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements PackageInfo pkg; try { pkg = getPackageManager().getPackageInfo(getPackageName(), 0); - builder.setMessage("ownCloud android client\n\nversion: " + pkg.versionName ); + builder.setMessage(String.format(getString(R.string.about_message), pkg.versionName)); builder.setIcon(android.R.drawable.ic_menu_info_details); dialog = builder.create(); } catch (NameNotFoundException e) { @@ -717,7 +721,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements mStorageManager.saveFile(newDir); // Display the new folder right away - mFileList.listDirectory(mCurrentDir); + mFileList.listDirectory(); } }); @@ -798,7 +802,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager() .findFragmentById(R.id.fileList); if (fileListFragment != null) { - fileListFragment.listDirectory(mCurrentDir); + fileListFragment.listDirectory(mCurrentDir); } } @@ -967,13 +971,13 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements return; } // a new chance to get the mDownloadBinder through getFileDownloadBinder() - THIS IS A MESS - mFileList.listDirectory(); + if (mFileList != null) + mFileList.listDirectory(); if (mDualPane) { FileDetailFragment fragment = (FileDetailFragment) getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG); if (fragment != null) fragment.updateFileDetails(); } - } @Override