How send data from fragment to activity in Android?

How send data from fragment to activity in Android?
Answer
To allow a Fragment to communicate up to its Activity, you can define an interface in the Fragment class and implement it within the Activity. The Fragment captures the interface implementation during its onAttach() lifecycle method and can then call the Interface methods in order to communicate with the Activity.
 

Tìm kiếm

Back
Top