Call Activity Method From Fragment

后端 未结 5 984
南笙
南笙 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:54

    You can use a static object in your activity, and use it from the fragment, or call the getActivity() method in your fragment to access the whole activity objects/methods

提交回复
热议问题