Skip to content

Using OnDialogResultListener #94

Answered by eltos
ocsike asked this question in Q&A
Discussion options

You must be logged in to vote

No, there is no addResultListener method, and this is for a very good reason (actually the reason this library came about in the first place): Android component lifecycles and configuration changes.

You can google these keywords to dive into the topic or read e.g. this article, but basically it boils down to the following: every dialog has to be disposable and re-creatable via saved instance states at any time to handle situations where the user switches apps, get's a call, turns the screen off or simply rotates the phone. This is not always possible when you set a result listener callback as you suggested; and even if it's possible, it will result in situations where the result listener …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ocsike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants