+ @Override\r
+ public void onDismiss(EditNameDialog dialog) {\r
+ //dialog.dismiss();\r
+ if (dialog.getResult()) {\r
+ String newDirectoryName = dialog.getNewFilename().trim();\r
+ Log.d(TAG, "'create directory' dialog dismissed with new name " + newDirectoryName);\r
+ if (newDirectoryName.length() > 0) {\r
+ String path;\r
+ if (mCurrentDir == null) {\r
+ // this is just a patch; we should ensure that mCurrentDir never is null\r
+ if (!mStorageManager.fileExists(OCFile.PATH_SEPARATOR)) {\r
+ OCFile file = new OCFile(OCFile.PATH_SEPARATOR);\r
+ mStorageManager.saveFile(file);\r
+ }\r
+ mCurrentDir = mStorageManager.getFileByPath(OCFile.PATH_SEPARATOR);\r
+ }\r
+ path = FileDisplayActivity.this.mCurrentDir.getRemotePath();\r
+ \r
+ // Create directory\r
+ path += newDirectoryName + OCFile.PATH_SEPARATOR;\r
+ Thread thread = new Thread(new DirectoryCreator(path, AccountUtils.getCurrentOwnCloudAccount(FileDisplayActivity.this), new Handler()));\r
+ thread.start();\r
+ \r
+ showDialog(DIALOG_SHORT_WAIT);\r
+ }\r
+ }\r
+ }\r