-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I implement the interface with my Fragment in Activity, I can't receive the Callback. #134
Comments
The library supports receiving callbacks in both Fragment and Activity. To receive the callback in a Fragment don't forget to call So create a simple dialog this way:
|
The standard callbacks are invoked in 2 cases:
Both listeners in activity and fragment can be invoked. If you implemented a custom dialog fragment and/or a custom listener you have to take care of it yourself (check source code). |
I'm sorry that I can't express my situation before. In fact, when I want to use it in a view, it doesn't work. |
The listener depends on activity or fragment, but not context. |
Although I don't want to use it in this way, but my team show dialog in a custom view in many places. So I have to solve this problem. |
Unfortunately, the listeners can't be used in a custom view this way, But if you write a bit of code, you can achieve the desired behaviour by propagating the callbacks from fragment/activity into your custom views. |
Thanks for your answers~ |
When I implement the interface with my Fragment in Activity, I can't receive the Callback.
The text was updated successfully, but these errors were encountered: