In many Android applications which I have found online or written myself, there is an application class like this:
public class MyApp extends Application {
private static MyApp instance;
public MyApp() {
super();
instance = this;
}
public static MyApp getInstance() {
return instance;
}
}
This pattern provides an easy access to application context and all application data from every point of our code. Because this pattern is widespread why don't Android framework developers make Application class a singleton by default?