Small improvement

This commit is contained in:
M66B 2022-12-07 08:01:14 +01:00
parent 000804e772
commit fb8c3c2582
1 changed files with 4 additions and 2 deletions

View File

@ -541,7 +541,7 @@ public class FragmentDialogFolder extends FragmentDialogBase {
});
List<String> result = new ArrayList<>();
result.add("");
result.add("-");
for (EntityFolder folder : folders)
result.add(folder.name);
@ -565,7 +565,9 @@ public class FragmentDialogFolder extends FragmentDialogBase {
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String parent = (String) spParent.getSelectedItem();
String parent = (spParent.getSelectedItemPosition() == 0
? null
: (String) spParent.getSelectedItem());
String name = etName.getText().toString().trim();
if (TextUtils.isEmpty(name))
sendResult(RESULT_CANCELED);