Call Activity Method From Fragment

后端 未结 5 969
南笙
南笙 2021-01-14 10:12

I\'m dealing with fragments.
I have an Activity and different fragments.
Each fragment need the access to a Class(call i

5条回答
  •  情话喂你
    2021-01-14 10:42

    From the fragment call your activity's method

    ((MyActivity )  getActivity()).getClassX() ;
    

提交回复
热议问题