How to get application object into fragment class
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 of my application class created as below:
appCtx = (UnityMobileApp) getApplication();
UnityMobileApp is my Application class.
Now I want to create the same instance in my fragment class. Can you guys please help me solve this?
One Solution collect form web for “How to get application object into fragment class”
appCtx = (UnityMobileApp) getActivity().getApplication(); in your fragment.