-                Intent i = new Intent(this, FileUploader.class);\r
-                i.putExtra(FileUploader.KEY_ACCOUNT,\r
-                        AccountUtils.getCurrentOwnCloudAccount(this));\r
-                String remotepath = new String();\r
-                for (int j = mDirectories.getCount() - 2; j >= 0; --j) {\r
-                    remotepath += "/" + URLDecoder.decode(mDirectories.getItem(j));\r
-                }\r
-                if (!remotepath.endsWith("/"))\r
-                    remotepath += "/";\r
-                remotepath += new File(filepath).getName();\r
-                Log.e("ASD", remotepath + "");\r
+    @Override\r
+    protected Dialog onCreateDialog(int id) {\r
+        Dialog dialog;\r
+        AlertDialog.Builder builder;\r
+        switch (id) {\r
+        case DIALOG_SETUP_ACCOUNT:\r
+            builder = new AlertDialog.Builder(this);\r
+            builder.setTitle(R.string.main_tit_accsetup);\r
+            builder.setMessage(R.string.main_wrn_accsetup);\r
+            builder.setCancelable(false);\r
+            builder.setPositiveButton(android.R.string.ok, this);\r
+            builder.setNegativeButton(android.R.string.cancel, this);\r
+            dialog = builder.create();\r
+            break;\r
+        case DIALOG_CREATE_DIR: {\r
+            builder = new Builder(this);\r
+            final EditText dirNameInput = new EditText(getBaseContext());\r
+            final Account a = AccountUtils.getCurrentOwnCloudAccount(this);\r
+            builder.setView(dirNameInput);\r
+            builder.setTitle(R.string.uploader_info_dirname);\r
+            int typed_color = getResources().getColor(R.color.setup_text_typed);\r
+            dirNameInput.setTextColor(typed_color);\r
+    \r
+            builder.setPositiveButton(android.R.string.ok,\r
+                    new OnClickListener() {\r
+                        public void onClick(DialogInterface dialog, int which) {\r
+                            String directoryName = dirNameInput.getText().toString();\r
+                            if (directoryName.trim().length() == 0) {\r
+                                dialog.cancel();\r
+                                return;\r
+                            }\r
+    \r
+                            // Figure out the path where the dir needs to be created\r
+                            String path = mCurrentDir.getRemotePath();\r
+                            \r
+                            // Create directory\r
+                            path += directoryName + "/";\r
+                            Thread thread = new Thread(new DirectoryCreator(\r
+                                    path, a));\r
+                            thread.start();\r
+    \r
+                            // Save new directory in local database\r
+                            OCFile newDir = new OCFile(path);\r
+                            newDir.setMimetype("DIR");\r
+                            newDir.setParentId(mCurrentDir.getFileId());\r
+                            mStorageManager.saveFile(newDir);\r
+    \r
+                            // Display the new folder right away\r
+                            dialog.dismiss();\r
+                            mFileList.listDirectory(mCurrentDir);\r
+                        }\r
+                    });\r
+            builder.setNegativeButton(R.string.common_cancel,\r
+                    new OnClickListener() {\r
+                        public void onClick(DialogInterface dialog, int which) {\r
+                            dialog.cancel();\r
+                        }\r
+                    });\r
+            dialog = builder.create();\r
+            break;\r
+        }\r
+        default:\r
+            dialog = null;\r
+        }\r
+    \r
+        return dialog;\r
+    }\r