I have created one class that is extending Application class and using the static method to expose the contexts as follows. moreover i am using many util methods like checking internet connections e.c.t into this class.
Problem is i am not sure
- how safe is to use following method to expose the application level context
would this create any memory leaks when i will use
App.getAppContext()
methodpublic class App extends Application { private static Context mContext; @Override public void onCreate() { super.onCreate(); mContext = this.getApplicationContext(); } public static Context getAppContext() { return mContext; }
}