Call Activity Method From Fragment

后端 未结 5 945
南笙
南笙 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() ;
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题