How to get application object into fragment class

后端 未结 4 2143
感情败类
感情败类 2020-12-29 18:15

I am changing my android mobile app to support both tablets and mobile phone. For this I am changing my activity class into fragment. In my activity class I have an instance

4条回答
  •  遥遥无期
    2020-12-29 18:34

    Use appCtx = (UnityMobileApp) getActivity().getApplication(); in your fragment.

提交回复
热议问题