Conversation
First deck name is shown twice when deleting two decks. Fixed by removing dialog after it is closed instead of just dismiss.
|
I tested the code and it works. In a similar issue (1371) the information that should be updated is in onPrepareDialog but it does not update because the dialog is already built. That issue would also be fixed by using removeDialog. Should removeDialog be avoided even if it works? |
|
I notice now that someone tried already to fix it with onPrepareDialog. As for your fix, remove dialog in the code is called only if the progress dialog is shown and it is not shown if you press cancel. I tried it and it does not seem to work for me at least.
At this point the dialog shows d1 instead of d2. The simpler fix is probably: What do you think? |
|
In terms of using removeDialog itself, removeDialog is less efficient as it means the dialog needs to be recreated instead of just being reused. It is usually better to instead update the dialog as necessary in onPrepareDialog. In this particular case, we could add removeDialog both to the case of pressing ok and cancel, but since onPrepareDialog should already be doing the right thing, there is no need. |
|
Sorry, I missed the cancel part. I still had issue 1371 in mind where onPrepareDialog doesn't seem work. Changing the if-statement is, as you said, a simpler and more clean fix. |
|
No problem. I probably would have missed it myself if I were doing the same fix maybe. I will close this pull request and ask ntsp to continue with his. |
Updates from my v2.0.1-dev branch
Removing some extra whitespace.
First deck name is shown twice when deleting two decks. Fixed by
removing dialog after it is closed instead of just dismiss.