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();

Where UnityMobileApp is my Application class.

  • How to get the first visible View from an Android ListView
  • Android add spacing below last element in recyclerview with gridlayoutmanager
  • Building/using runtime generated layout XML in Android
  • overridePendingTransition not working
  • Full screen transparent activity (no title & status bar) doesn't work… why?
  • How to get the absolute coordinates of a view
  • Now I want to create the same instance in my fragment class. Can you guys please help me solve this?

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.