Skip to content

Commit 329f05a

Browse files
committed
Fix double-trigger of editor dialog
Signed-off-by: Aron Heinecke <aron.heinecke@t-online.de>
1 parent 442d941 commit 329f05a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/src/main/java/vocabletrainer/heinecke/aron/vocabletrainer/activity/EditorActivity.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,14 @@ private void showEntryEditDialog(final VEntry entry) {
348348
* @param entry VEntry to edit/create
349349
* @param position edit position in list, if existing
350350
*/
351-
private void showEntryEditDialog(final VEntry entry, final int position) {
351+
private synchronized void showEntryEditDialog(final VEntry entry, final int position) {
352352
if (entry.getId() == ID_RESERVED_SKIP) {
353353
showTableInfoDialog();
354354
return;
355355
}
356+
if(editorDialog != null && editorDialog.isAdded()) {
357+
return;
358+
}
356359

357360
this.editPosition = position;
358361
this.editorEntry = entry;
@@ -404,7 +407,10 @@ private void setListEditorActions() {
404407
* Show list title editor dialog<br>
405408
* Exit editor when newTbl is set and user cancels the dialog
406409
*/
407-
private void showTableInfoDialog() {
410+
private synchronized void showTableInfoDialog() {
411+
if(listEditorDialog != null && listEditorDialog.isAdded()) {
412+
return;
413+
}
408414
listEditorDialog = VListEditorDialog.newInstance(!list.isExisting());
409415
setListEditorActions();
410416
listEditorDialog.show(getSupportFragmentManager(), VListEditorDialog.TAG);

0 commit comments

Comments
 (0)