public class MyApplication extends Application {
private MyData myData;
public static MyApplication get(Context context) {
return (MyApplication) context.getApplicationContext();
}
public MyData getMyData() {
if (myData == null) {
myData = new MyData();
}
return myData;
}
}