I have a custom dialog that displays normally, but it closes immediately, because its completion method is called immediately after it displays. I used to use a toast message, and it had no problem staying in the same circumstances.
Iβm sure that the problem is that the user dialog, unlike the Toast message, βbelongsβ to the activity, so when the activity leaves, the dialog also disappears. I was thinking of adding a listener with setOnShowListener, but I don't think this will work - if the listener somehow does not block the finish. I could add a timer delay, but this is not a very attractive solution. What is a good solution here?
source share