Alternatively, you can override the Application class:
public class App extends Application { private static Context sInstance; @Override public void onCreate() { super.onCreate(); sInstance = this; } public static Context getInstance() { return sInstance; } }
And further, in the LS class constructor, initialize the corresponding field:
public class LS { private Context mAppContext; public LS() { mAppContext = App.getInstance(); } }
But in general, IMHO, there is no need to store the ApplicationContext in a separate field. When you need access to it, just get it using App.getInstance() .
As an addition: when sending a link to an activation somewhere, be very careful, because it is fraught with memory leaks.