Sir/Madam, I want to make a callback result to one fragment to another fragment using android JAVA. I try-out to find the issue but non of the solution found. If i using interface it send callback response to Activity, which i didn't want. thank you!
Asked
Active
Viewed 343 times
-1
-
Can you share the code you tried to make the callback? – Zulqarnain Jan 23 '20 at 12:50
-
@Zulqarnain. I have tried using interfaces which return callback to activity. – Sentinel Technologies Jan 24 '20 at 06:19
-
follow this: https://stackoverflow.com/a/24382033/6825339 – Zulqarnain Jan 24 '20 at 06:46
1 Answers
1
You have many options to do so:
Shared ViewModel (Recommended) (https://medium.com/@abhilashmyworld/communicate-between-fragments-using-viewmodel-e83344e9df53)
EventBus
Through the Hosting activity (calling method on fragment object)
Passing objects
Broadcast (too old school)

Sandesh Baliga
- 579
- 5
- 20