Communicating between a fragment and an activity - best practices

后端 未结 9 1319
予麋鹿
予麋鹿 2020-11-22 02:45

This question is mostly to solicit opinions on the best way to handle my app. I have three fragments being handled by one activity. Fragment A has one clickable element th

9条回答
  •  难免孤独
    2020-11-22 03:39

    You can create declare a public interface with a function declaration in the fragment and implement the interface in the activity. Then you can call the function from the fragment.

提交回复
热议问题